from collections import deque
N=int(input())
X=[chr(i+97) for i in range(N)]
q=deque(["a"])
while(len(q)>0):
    r=q.popleft()
    k=len(set(r))
    for i in range(k+1):
        p=r+X[i]
        if len(p)==N:
            print(p)
        else:
            q.append(p)
