N =int(input())

if N==1:
    print("a")
    exit()
if N==2:
    print("aa")
    print("ab")
    exit()

ans=["aa","ab"]

def func(s, n=-1):
    ns = []
    for ch in s:
        # A - Z
        if ('A' <= ch and ch <= 'Z'):
            ns.append(chr((ord(ch) - ord('A') - n) % 26 + ord('A')))
        # a - z
        elif ('a' <= ch and ch <= 'z'):
            ns.append(chr((ord(ch) - ord('a') - n) % 26 + ord('a')))
        # 0 - 9
        elif ('0' <= ch and ch <= '9'):
            ns.append(chr((ord(ch) - ord('0') - n) % 10 + ord('0')))
        # no change for other characters
        else:
            ns.append(ch)
    return "".join(ns)

# print(func("aabb"))

for _ in range(N-2):
    riv=[func(i) for i in ans]
    riv.append(func(ans[-1])[:-1]+'a')
    riv.sort()
    # print(riv)
    a = ans+riv
    ans=['a'+i for i in a]

for i in ans:
    print(i)
