from string import ascii_letters for i in ascii_letters: for j in ascii_letters: for k in ascii_letters: for l in ascii_letters: print(i, j, k, l)