#!/usr/bin/env python3
import sys
import itertools

def solve(N: int):
    string = "abcdefghijk"
    print("a"*N)
    ans = []
    for i in range(1,N): #i何個に分割するか
        pattern = list(itertools.combinations(list(range(1,N)),i))
        for k in range(len(pattern)):
            answer = ""

            for j in range(i):
                if j == 0:
                    answer += string[j]*pattern[k][j]
                else:
                    answer += string[j]*(pattern[k][j]-pattern[k][j-1])
            else:
                answer += string[i]*(N-pattern[k][-1])

            ans.append(answer)
    ans.sort()
    for i in range(len(ans)):
        print(ans[i])
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
