N = input()

N = int(N)
if N == 1:
    print("a")
    exit()
# 97 a
string_list = []


def temp(now, string, count):
    if count == N:
        string_list.append(string)
        return 0
    temp(now, string+chr(now), count+1)
    temp(now+1, string+chr(now+1), count+1)
    if now != 97:
        temp(now-1, string+chr(now-1), count+1)
    return 0


temp(97, "a", 1)
string_list.sort()
print(string_list)