def dfs(ans, n, l):
    if len(ans) == n:
        print(ans)
        return ans
    for x in l:
        dfs(ans + x, n, l)


n = int(input())
s = 'abcdefghij'
l = [s[i] for i in range(n)]

ans = 'a'
dfs(ans, n, l)
