Okay, then I use Huckel's rule, pyrrole N atom needs to donate its electron pair to the ring so it will follow the rule, in imidazole to make the same effect, only the electron pair from one N atom is enough to follow the rule, so there is a pair that can be donated to a H+ ion, so imidazole is more basic. The compound in the middle has 3 F atoms that push the N electron pair from it, so it is less available, while the pair in the other N atom follows Huckel's rule.
That is clear I think, only one more thing: I don't understand why is pyrimidine less basic than pyridine. The N atom in both molecules needn't to donate an electron pair.