Answer: A, B
In pyrrole and at the N-H nitrogen of imidazole, the lone pair is donated into the ring to give six pi electrons. In pyridine and at N-3 of imidazole the nitrogen has a double bond in the ring, contributing one p electron, and the lone pair is in an in-plane sp2 orbital available for protonation.