
N = int(input())
AOrd = ord('a')
S = [AOrd] * N


def printout(arr):
    out = []
    for o in arr:
        out.append(chr(o))
    print(''.join(out))


def S_Incr(i, j):
    if S[j] <= S[i]:
        S[j] += 1
        return True
    else:
        return False


def S_IncrMajor(i):
    if (i > 0) and (S[i] <= S[i-1]):
        S[i] += 1
        for j in range(i+1, N, 1):
            S[j] = AOrd
        return True
    else:
        return False


pos = N - 1
printout(S)
while (pos > 0):
    while S_Incr(pos-1, pos):
        printout(S)
    if S_IncrMajor(pos-1):
        pos = N - 1
        printout(S)
    else:
        pos -= 1
exit()

