n = int(input())
def func2(n):
    if n == 1:
        return "a"
    ll = []
    for head in func2(n-1):
        for tail in [chr(i + 97) for i in range(2) ]:
           ll.append(head + tail)
    return ll

def func3(n):
    if n == 3:
        return ["abc"]
    ll = []
    for head in func3(n-1):
        for tail in [chr(i + 97) for i in range(3) ]:
           ll.append(head + tail)
    return ll

def func4(n):
    if n == 4:
        return ["abcd"]
    ll = []
    for head in func4(n-1):
        for tail in [chr(i + 97) for i in range(4) ]:
           ll.append(head + tail)
    return ll

if n == 1:
    print("a")
elif n == 2:
    for i in func2(n):
        print(i)
elif n == 3:
    for i in func2(n) + func3(n):
        print(i)
elif n == 4:
    for i in func2(n) + func3(n) + func4(n):
        print(i)