N = int(input())
int2char = {i: chr(i + 96) for i in range(1, 11)}
ans = ['a']
for n in range(2, N+1):
    new_list = []
    for string in ans:
        str_set = set(string)
        for i in range(1, n+1):
            if len(str_set) + 1< i:
                continue 
            new_str = string + int2char[i]
            new_list.append(new_str)
    ans = new_list

print(sorted(ans))