def dfs(now, count):
    if count == n:
        print(now)
    else:
        for i in range(count + 1):
            dfs(now + al[i], count + 1)


n = int(input())

al = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

dfs('a', 1)
