N = int(input())

dp = [[] for _ in range(N)]
dp[0].append('a')

for i in range(1, N):
    for strings in dp[i-1]:
        j = 97
        while j <= ord(strings[-1])+1:
            nextstr = strings
            nextstr += chr(j)
            dp[i].append(nextstr)
            j += 1

dp[N-1].sort()

for strings in dp[N-1]:
    print(strings)