A compound represented by, e.g. the formula (I):
[wherein X, Y, Z, and W each independently represent optionally substituted methine; A, B, and D each independently represent —C(O)—, etc.; Q represents a methine or a nitrogen; and R represents the formula (II-1), optionally substituted with lower alkyl, etc.;
(wherein R
6
represents a lower alkyl, etc; and R
7
and R
8
each independently represents a lower alkyl, etc.)] or a pharmaceutically acceptable salt of the compound. The compounds and salt have antagonistic activity against a histamine H3 receptor or inverse agonistic activity against a histamine H3 receptor. They are useful in the prevention or treatment of metabolic diseases, circulatory diseases, or neurotic diseases.