import itertools
n=int(input())
r=[]
for s in itertools.combinations_with_replacement('abcdefghij'[:n],n):
    for _r in r:
        for i in range(n):
            if ord(_r[0])-ord(_r[i]) != ord(s[0])-ord(s[i]):
                break
        else:
            break
    else:
        r.append(s)
for i in range(len(r)):
    print(''.join(r[i]))