From the structures of the four compounds, It is clear that in pyrrole, the electron pair on nitrogen is involved in delocalisation of the ring. So, it is least basic. In aniline, the electron pair involved in conjugation with the π−electrons of the ring while in pyridine it is relatively free. Guanidine is a strong base.