N = int(input())

ALP = "abcdefghij"

result = []

def mx(s):
    m = 0
    for i in s:
        if m < int(i):
            m = int(i)
    return m

def add(res):
    res_c = []
    for r in res:
        m = mx(r)
        for i in range(1, m + 2):
            res_c.append(r + str(i))
    return res_c
for n in range(N):
    if n == 0:
        result.append("1")
    else:
        result = add(result)

v = []
for i in range(1, N + 1):
    v = []
    for j in result:
        a = j.replace(str(i), ALP[i - 1])
        v.append(a)
    result = v

for r in result:
    print(r)