ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


n = ii()
dp = [""]
dp[0] = "a"
for i in range(1,n):
    dpat = []
    tmp = i+1
    for j in range(len(dp)):
        for i in range(tmp):
            dpat.append(dp[j] + chr(97+i))
    dp = dpat
if n == 1:
    print("a")
else:
    for i in range(len(dp)):
        print(dp[i])

