Search for pair production of first and second generation leptoquarks in proton-proton collisions at root s=8 TeV