#coding:utf-8

n = int(input()) # 1 <= n <= 10

lis = [0 for i in range(n)]
last = 0
now = 0
now_s = ''
a_list = ['a','b','c','d','e','f','g','h','i','j']

def converter(x,a,n):
    #a進数からn進数への変換
    t = 0
    out = 0
    y = -1
    while not x == 0:
        y = x % n
        out += y * (a ** t)
        x = (x - y) / n
        t += 1
    return int(out)

for i in range(n):
    last += i * (10 ** (n - i - 1))

last = converter(last,n,10) + 1

while not now == last:
    now = converter(now,10,n)
    d = now
    now_s = ''
    for i in range(n):
        c = d // (10 ** (n - i - 1))
        now_s += a_list[c]
        d -= c * (10 ** (n - i - 1))
    print(now_s)
    now = converter(now,n,10)
    now += 1