N = int(input())

ans = ['a']
for i in range(N-1):
    tmp = []
    for s in ans:
        j = ord(s[-1]) - ord('a') + 1
        for k in range(j+1):
            tmp.append(s + chr(ord('a') + k))
    ans = tmp
print(*ans, sep='\n')