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[i].append(["a",1])
    else:
        for j in range(len(ans_list[i-1])):
            for l in range(ans_list[i-1][j][1]+1):
                temp = ans_list[i-1][j][0] + alp[l]
                if l == ans_list[i-1][j][1]:
                    chk = ans_list[i-1][j][1]+1
                else:
                    chk = ans_list[i-1][j][1]
                ans_list[i].append([temp,chk])
for i in range(len(ans_list[N-1])):
    print(ans_list[N-1][i][0])