n = int(input())
for i in range(n):
    #print("i", i)
    res = [0] * n
    if i != 0:
        res[n-i] += 1
    else:
        resstr = list(map(lambda x: chr(ord("a") + x), res))
        print("".join(resstr))
        continue
    while res[n-i] == 1:
        resstr = list(map(lambda x: chr(ord("a") + x), res))
        print("".join(resstr))
        res[-1] += 1
        for j in range(1, i):
            #print("try", n-j)
            if res[n-j] > (res[n-j-1] + 1):
                res[n-j] = 0
                res[n-j-1] += 1
    continue
    res = list(map(lambda x: chr(ord("a") + x), res))
    print("".join(res))