Provided are novel compounds that are useful in the prevention or treatment of such diseases as dementia, Alzheimer's disease, attention-deficient hyperactivity disorder, schizophrenia, epilepsy, central convulsion, obesity, diabetes mellitus, hyperlipidemia, narcolepsy, idiopathic hypersomnia, behaviorally induced insufficient sleep syndrome, sleep apnea syndrome, circadian rhythm disorder, parasomnia, sleep related movement disorder, insomnia, and depression, or allergic rhinitis, or pharmaceutically acceptable salts of such compounds. Specifically, there are provided phenylpyrrole compounds represented by the following formula (I) or pharmaceutically acceptable salts thereof:Formula (I)[wherein Q refers to a group represented by the following formula (A) or (B):