

n = int(input())


result = []
start = ''

# n=5だったら11111~12345の全組み合わせを生成してみる

def search(loopcnt, now, prev):
    if loopcnt > n:
        result.append(prev)
    else:
        for k in range(1, now+2):
            if k == 10:
                k =0
            search(loopcnt + 1, k, prev + str(k))
        
n -= 1
search(0, 0, '')

set(result)

kouho = [ chr(97+i) for i in range(n+1) ]

for r in result:
    for c in r:
        print(kouho[int(c)-1], end='')
    print()