# Problem D - String Equivalence

from collections import deque

# input
N = int(input())

char_list = [chr(i) for i in range(97, 97+26)]

def dfs(a_list, a_len, char_count):
    if a_len==N:
        print("".join(a_list))
    else:
        for i in range(char_count):
            a_list.append(char_list[i])
            dfs(a_list, a_len+1, i + 2)
            a_list.pop()

# initialization
a_nums = deque([])

# dfs search
dfs(a_nums, 0, 1)
