import collections
import numpy as np
import sys
sys.setrecursionlimit(10**8)
#N,K=map(int,input().split())
N=int(input())
#h=np.array(list(map(int,input().split())))
#ans=0
num2alpha = lambda c: chr(c+96)
def dfs(K,b,s):
    if len(s)==K+1:
        return b.append(s)
    elif len(s)>=K+1:
        return
    else:
        for i in range(N):
            if i<= len(set(s)):
                s=s+num2alpha(i+1)
                dfs(K, b, s)
B=list()
m=""
dfs(N-1,B,m)
for i in B:
    print(i)
