The present invention provides the following compound having anti-HIV activity of formula:wherein, A1 is C, CR1A or NA2 is C, CR2A, or NA3 is CR3A, CR3AR3B, N, NR3c O, S, SO, or SO2 A4 is CR4A, CR4AR4B, N, NR4C O, S, SO, or SO2A5 is C, CR5A, or NT1 ring is substituted or unsubstituted monocyclic carbocycle or substituted or unsubstituted monocyclic heterocycleR1 is halogen, cyano, nitro or -X1-R11R2 is substituted or unsubstituted alkyl and the liken is 1 or 2R3 is hydrogen, substituted or unsubstituted aromatic varbocyclylR4 is hydrogen or a carboxy protecting groupthe other symbols are as specified in the description.