Molecular orbital theory of the hydrogen bond. 20. Pyrrole and imidazole as proton donors and proton acceptors