A compound of the formula:whereinX is -N=, -CH=, or the likeW is -CH2- or the likeU is -S- or the likeR1 and R2 are each independently hydrogen, halogen, optionally substituted lower alkyl, or the likeR3 is hydrogen or the likeeach R4 is independently hydrogen, halogen, or the likem is an integer from 0 to 2Q is a single bond, or the likeG is -C(=O)-, or the likeD is a single bond, -NH-, or the like andE is a cyclic quaternary ammonium group,or an ester, a protected compound at the amino on the ring in the 7-side chain, a pharmaceutically acceptable salt, or a solvate thereof.