import numpy as np
N = int(input())
s_lis = ["a"]
s_list = np.array(s_lis)
for i in range(N-1):
    ss = np.array([])
    for s in s_list:
        ss = np.append(ss,s + (s[-1]))
        ss = np.append(ss,s + chr(ord(s[-1])+1))
    s_list = np.copy(ss)
if N == 1 :
    print (s_lis[0])
else :
    for i in ss:
        print(i)