import itertools
N = int(input())

ans = []

for x in range(2, N + 1):
    C = itertools.combinations(range(N), x)
    cnt = ord("a")
    a = [None] * N
    for c in C:
        cnt = ord("a")
        a = [None] * N
        for cc in c:
            a[cc] = chr(cnt)
        cnt += 1
        for i in range(N):
            if a[i] is None:
                a[i] = chr(cnt)
                cnt += 1
        ans.append(a)

cnt = ord("a")
a = [None] * N
for i in range(N):
    a[i] = chr(cnt)
    cnt += 1
ans.append(a)


                
ans = sorted(ans)

for a in ans:
    for i in range(N):
        print(a[i], end="")
    print()






