The present invention provides novel compounds having a P2X3 and/or P2X2/3 receptor antagonistic effect.A pharmaceutical composition having a P2X3 and/or P2X2/3 receptor antagonistic effect comprising a compound of the formula (I):whereinring A is substituted or unsubstituted 5 to 7-membered cycloalkane, substituted or unsubstituted 5 to 7-membered cycloalkene or the like;C is a carbon atom;—X— is —N(R16)— or the like;R16 is hydrogen, substituted or unsubstituted alkyl or the like;R7 is substituted or unsubstituted 5- or 6-membered heteroaryl, substituted or unsubstituted 6 to 10 membered aryl;Q1 and Q2 are each independently a carbon atom or a nitrogen atom;-L- is —O—, —S— or the like;R6 is substituted or unsubstituted cycloalkyl, substituted or unsubstituted cycloalkenyl or the like;R2 is hydrogen, hydroxy or the like,or its pharmaceutically acceptable salt or a solvate thereof.