n = int(input())

ans = ['a'] * n

while 1:
    print(''.join(ans))
    for i in range(n-1, 0, -1):
        if ord(ans[i]) <= ord(ans[i-1]):
            ans[i] = chr(ord(ans[i]) + 1)
            for j in range(i+1, n):
                ans[j] = 'a'
            break
    else:
        break