N = int(raw_input())

char_list = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

prev = ["a"]

for i in range(1, N):
    temp = []
    for item in prev:
        item_list = []
        for j in range(len(item)):
            item_list.append(item[j])
        num_char = len(set(item_list))
        for j in range(num_char+1):
            temp.append(item+char_list[j])

    prev = temp


print ' '.join(map(str, prev))