N = int(input())

#文字数分aで埋める
#末尾をbにする
#一桁上の文字+1文字までは許容するルールで増加させていく

import itertools

stop_combination = [chr(i) for i in range(97,97+N)]
combination_list = list(itertools.product(stop_combination, repeat=N))

printed_expression = set()

for combination in combination_list:
    #print(combination,":",end="")

    if list(combination) == stop_combination:
        print(''.join(map(str, combination)))
        break

    character_dict = dict()
    character_number = 0
    alternative_expression = ""

    for character in combination:
        if character not in character_dict:
            character_dict[character] = character_number
            alternative_expression += str(character_number)
            character_number += 1
        else:
            alternative_expression += str(character_dict[character])

    #print(alternative_expression)

    if alternative_expression not in printed_expression:
        print(''.join(map(str, combination)))
        printed_expression.add(alternative_expression)