import itertools
N = int(input())

nums = [chr(i) for i in range(97, 97+N)]

tmp = []
for balls in itertools.product(nums, repeat=len(nums)):
    tmp.append(balls)
    
for i in range(len(tmp)//N):
    print("".join(list(tmp[i])))