def main():
    n = int(input())
    ans = []
    for i in range(2**(n-1)):
        s = "a"
        x = i
        for j in range(n-1):
            if x % 2 == 1:
                s += "a"
            else:
                s += "b"
            x //= 2
        ans.append(s)
    ans.sort()
    for s in ans:
        print(s)

if __name__ == "__main__":
    main()