N=int(input())

char="abcdefghijklmnopqrstuvwxyz"

def print_nth(base,n):
    global char, N
    for i in range(n):
        str_n = base + char[i]
        if (n==N):
            print(str_n)
        elif (N>n):
            print_nth(str_n, n+1)

print_nth("",1)