N = int(input())

tarans = {'1':'a','2':'b','3':'c','4':'d','5':'e','6':'f','7':'g','8':'h','9':'i'}
ans = ['1']

for i in range(2,N+1):
    temp = []

    for num in ans:
        for k in range(2):
            s = '1'
            for j in range(len(num)):
                s = s + str(int(num[j])+k)
            temp.append(s)
    ans = temp

ans.sort()

for s in ans:
    print(s.replace("10",'j').translate(str.maketrans(tarans)))