N = int(input())
w = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']


def dfs(s, i):
    if i == N-1:
        ans = ''
        for i in range(N):
            ans += w[int(s[i])]
        print(ans)
    else:
        dfs(s+s[-1], i+1)
        dfs(s+str(int(s[-1])+1), i+1)


x = dfs('0', 0)
