N = int(input())

def Base_10_to_n(X, n):
    if (int(X//n)):
        return Base_10_to_n(int(X//n), n)+str(X%n)
    return str(X%n)

def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(X[-i])*(n**(i-1))
    return out#int out

d2a = {
    '0': 'a',
    '1': 'b',
    '2': 'c',
    '3': 'd',
    '4': 'e',
    '5': 'f',
    '6': 'g',
    '7': 'h',
    '8': 'i',
    '9': 'j',
}

limit_str = '0123456789'
for i in range(N):
    start = int(limit_str[:i+1])
    end = int(limit_str[:i+2])
    if i == N-1:
        print('abcdefghij'[:i+1])
        break
    if i == 0:
        print('a'*N)
        continue
    # print(start,end)
    num = Base_n_to_10(str(start), i+1)
    while True:
        bc = Base_10_to_n(num, i+1)
        if int(bc) >= end:
            break
        sl = len(bc)
        # print('#', bc, sl, limit_str[:sl+1])
        if int(bc) <= int(limit_str[:sl+1]):
            bcs = bc.zfill(N)
            for k, v in d2a.items():
                bcs = bcs.replace(k, v)
            print(bcs)
            # print(bc)
        num += 1