def chg(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

N = int(input())
li = list("abcdefghij")

import sys
if N==2:
    print("aa")
    print("ab")
    sys.exit()
for i in range(10**6):
    mm = str(chg(i,N)).zfill(N)
    cnt = -1
    li1 = []
    for j in range(N):
        a = int(mm[j])
        if str(a) in li1:
            continue
        elif a-1==cnt:
            cnt += 1
            li1.append(str(a))
            continue
        break
    else:
        for j in range(N):
            print(li[int(mm[j])],end="")
        print()
    # print(mm)

# print(10*9*8*7*6*5*4*3*2)

