The present invention provides novel compounds having a P2X 3 and/or P2X 2/3 receptor antagonistic effect. A pharmaceutical composition having a P2X 3 and/or P2X 2/3 receptor antagonistic effect comprising a compound of the formula (I): wherein ring 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(R 16 )- or the like; R 16 is hydrogen, substituted or unsubstituted alkyl or the like; R 7 is substituted or unsubstituted 5- or 6-membered heteroaryl, substituted or unsubstituted 6 to 10 membered aryl; Q 1 and Q 2 are each independently a carbon atom or a nitrogen atom; -L- is -O-, -S- or the like; R 6 is substituted or unsubstituted cycloalkyl, substituted or unsubstituted cycloalkenyl or the like; R 2 is hydrogen, hydroxy or the like, or its pharmaceutically acceptable salt or a solvate thereof.