alp = ["a","b","c","d","e","f","g","h","i","j"]
N = int(input())
ans_list = []
for i in range(N):
    ans_list.append([])
for i in range(N):
    if i == 0:
        ans_list[0].append("a")
    else:
        for j in range(len(ans_list[i-1])):
            if ans_list[i-1][j][-1] == "a":
                for l in range(2):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "b":
                for l in range(3):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "c":
                for l in range(4):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "d":
                for l in range(5):
                    temp = ans_list[i-1][j]+ alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "e":
                for l in range(6):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "f":
                for l in range(7):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "g":
                for l in range(8):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "h":
                for l in range(9):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
            elif ans_list[i-1][j][-1] == "i":
                for l in range(10):
                    temp = ans_list[i-1][j] + alp[l]
                    ans_list[i].append(temp)
for i in range(len(ans_list[N-1])):
    print(ans_list[N-1][i])
