N = int(input())
def next(S):
    ans = []
    n = len(S)
    for i in range(n):
        s = S[i]
        m = len(s)
        fin = s[m-1]
        l = (ord(fin)-18)%26
        for j in range(l+1):
            ans.append(s+chr(j+97))
    return ans
S = "a"
for i in range(N-1):
    S = next(S)
p = len(S)
for i in range(p):
  print(S[i])