import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def solve():
    n = int(input())
    ans = ["a"]
    alt = [chr(ord("a") + i) for i in range(n)]
    for i in range(n-1):
        ans = [s+x for s in ans for x in alt [0:len(set(ans))+1]]
    for i in ans:
        print(ans)
    return 0

if __name__ == "__main__":
    solve()