n = int(input())

alphabet = ['a','b','c','d','e','f','g','h','i','j']
w = ['a']

for num in range(n-1):
    x = []
    for i in range(len(w)):
        for j in range(n):
            x.append(w[i] + alphabet[j])
    w = x

for _ in range(len(w)):
    print(w[_])