from collections import deque
n=int(input())
L=['a','b','c','d','e','f','g','h','i','j']
ans=['a']
for i in range(2,n+1):
    que=deque(L[:i])
    temp2=[]
    while que:
        moji=que.popleft()
        temp=[]
        for a in ans:
            a+=moji
            temp.append(a)
        temp2+=temp
    ans=temp2
ans.sort()
print(*ans, sep='\n')