import random def to_letter(n): if n > 25: return chr(n-26+ord('A')) return chr(n+ord('a')) n, k = 500000, 30 print(n, k) for i in range(n): print(to_letter(random.randint(0, k-1)), end="") print() for i in range(n): print(to_letter(random.randint(0, k-1)), end="") print()