N=int(input())

char="abcdefghijklmnopqrstuvwxyz"

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

print_nth("",1,0)