import itertools
n=int(input())
r=[]
for s in itertools.combinations_with_replacement([chr(i) for i in range(97, 97+26)],n):
    for _r in r:
        for p in itertools.permutations(range(0,n), 2):
            if ((_r[p[0]]==_r[p[1]]) and (s[p[0]]==s[p[1]])) or ((_r[p[0]]!=_r[p[1]]) and (s[p[0]]!=s[p[1]])):
                continue
            else:
                break
        else:
            break
    else:
        r.append(s)
for i in range(len(r)):
    print(''.join(r[i]))
