The present invention provides an aromatic ring compound having a melanin-concentrating hormone receptor antagonistic action and useful as an agent for the prophylaxis or treatment of obesity and the like. The present invention relates to a compound represented by the formulawherein each symbol as defined in the specification, or a salt thereof.