N = int(input())
ans = []
def dfs(tmp,i):
    if i == N:
        ans.append(tmp)
        return
    
    for s in ["a", "b"]:
        dfs(tmp+s, i+1)
    return ans
dfs("a", 1)
for s in ans:
    print(s)