import itertools

n = int(input())

moji = [
    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
]
moji = moji * 10
moji = sorted(moji)

l = []
for v in itertools.permutations(moji, n):
    l.append(v)

ll = []
ll = sorted(set(l))

for i in range(n):
    print((','.join(ll[i]).replace(",", "")))
