Answer: B
The ring nitrogen is protonated in each case. The −NHX2 group at C-4 can push its lone pair to the ring nitrogen (+M), strongly raising basicity. At C-3 it cannot conjugate with the ring nitrogen, so only a weak effect operates. Pyridine is unsubstituted, while the nitro group at C-4 withdraws electrons by -M and -I, making it the weakest base. The order is I > II > III > IV.