Disclosed is a compound which is useful as an 11 β-hydroxysteroid dehydrogenase type I inhibitor. Specifically disclosed is a compound represented by the following formula (I) : (wherein ring A represents (II); ring B represents an optionally substituted heteroaryl (excluding an optionally substituted isoxazole) or an optionally substituted heterocycle; R represents a hydrogen or an optionally substituted alkyl; R represents -OR, -SR, a halogen, a halogenated alkyl or the like; R represents an optionally substituted alkyl or the like; R represents an optionally substituted alkyl or the like; R represents an optionally substituted alkyl or the like; R represents a hydrogen or the like; R and R independently represent a hydrogen or the like; R and R independently represent a hydrogen or the like; R represents an optionally substituted alkyl or the like; and m and p independently represent an integer of 1-3), a pharmaceutically acceptable salt thereof, or a solvate of any of them.