Is to provide a novel compound having an anti-viral activity, particularly a HIV integrase inhibitory activity, and a pharmaceutical composition, particularly an anti-HIV agent. (wherein R 1 is hydrogen or lower alkyl X is lower alkylene etc. R 2 is optionally substituted aryl R 3 is hydrogen, halogen, hydroxy, optionally substituted lower alkyl etc. R 4 is hydrogen, optionally substituted lower alkyl, optionally substituted cycloalkyl, optionally substituted cycloalkyl lower alkyl, optionally substituted aryl, optionally substituted aryl lower alkyl, optionally substituted heterocyclic group, optionally substituted heterocyclic lower alkyl etc. A broken line indicates the presence or absence of a bond B 1 and B 2 are such that any one of them is CR 20 R 21 , and the other is NR 22 and, in this case, there is no broken line. When B 2 is NR 22 , R 4 and R 22 may be connected together to form an optionally substituted heterocycle When B 2 is CHR 21 , R 4 and R 21 may be connected together to form an optionally substituted heterocycle. Alternatively, B 1 and B 2 are independently C, CR 23 or N and, in this case, B 1 and B 2 may be taken together to form a heterocycle. R 20 , R 21 , R 22 and R 23 are independently hydrogen, optionally substituted lower alkyl, optionally substituted cycloalkyl, optionally substituted cycloalkyl lower alkyl etc.)