fork(1) download
  1. def main():
  2. alphabet = 'abcdefghijklmnopqrstuvwxyz'
  3. a, b = map(int, input().split())
  4. req = max(a, b//2+1)
  5. tot = 0
  6. for a in alphabet:
  7. for b in alphabet:
  8. for c in alphabet:
  9. for d in alphabet:
  10. print(a+b+c+d, end=' ')
  11. tot += 1
  12. if tot >= req:
  13. print()
  14. return
  15.  
  16.  
  17. if __name__ == '__main__':
  18. main()
Success #stdin #stdout 0.02s 9292KB
stdin
2 7
stdout
aaaa aaab aaac aaad