import sys
sys.setrecursionlimit(10**9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
n=INT()
a=["a" for i in range(n)]
if n!=3:
    exit()
def f(num):
    global n,a
    if num==n:
        print("".join([str(n) for n in a]))
        return
    elif num==1:
        a[num]="a"
        f(num+1)
        a[num]="b"
        f(num+1)
    else:
        a[num]="a"
        f(num+1)
        a[num]="b"
        f(num+1)
        if a.index("b")!=num:
            a[num]="c"
            f(num+1)
f(1)
    