from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations # (string,3) 3回

from collections import deque

from collections import defaultdict

import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7



def readInts():

  return list(map(int,input().split()))



def main():

    n = int(eval(input()))

    # 一番大きいものは何か、それを保存してdfs

    def dfs(cnt, s):

        if cnt == n:

            print(s)

            return

        biggest = 'a'

        c = 0

        while c < len(s):

            if s[c] == biggest:

                biggest = chr(ord(biggest)+1)

                c += 1

            else:

                c += 1

        for i in range(0,ord(biggest) - ord('a') + 1):

            sc = chr(ord('a')+i)

            s += sc

            dfs(cnt + 1, s)

            s = s[:-1]

    dfs(0,"")

if __name__ == '__main__':

  main()

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations,permutations,accumulate, product # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict,Counter

import decimal

import re

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#

# my_round_int = lambda x:np.round((x*2 + 1)//2)

# 四捨五入g

import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

  return list(map(int,input().split()))

def I():

  return int(input())

n = I()

ans = ['a']

for i in range(n-1):

    tmp = []

    for s in ans:

        m = max(s)

        j = ord(m)-ord('a') + 1

        for k in range(j+1):

            tmp.append(s+chr(ord('a') + k))

    ans = tmp

print(*ans, sep='\n')

from statistics import median

# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations  # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect

#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7


def readInts():
    return list(map(int, input().split()))


def main():
    n = int(eval(input()))
    # 一番大きいものは何か、それを保存してdfs
    def dfs(cnt, s):
        if cnt == n:
            print(s)
            return
        biggest = "a"
        c = 0
        while c < len(s):
            if s[c] == biggest:
                biggest = chr(ord(biggest) + 1)
                c += 1
            else:
                c += 1
        for i in range(0, ord(biggest) - ord("a") + 1):
            sc = chr(ord("a") + i)
            s += sc
            dfs(cnt + 1, s)
            s = s[:-1]

    dfs(0, "")


if __name__ == "__main__":
    main()

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations, accumulate, product  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict, Counter
import decimal
import re

# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(input())


n = I()
ans = ["a"]
for i in range(n - 1):
    tmp = []
    for s in ans:
        m = max(s)
        j = ord(m) - ord("a") + 1
        for k in range(j + 1):
            tmp.append(s + chr(ord("a") + k))
    ans = tmp
print(*ans, sep="\n")

-from statistics import median - +# from statistics import median -from itertools import combinations  # (string,3) 3回 -from collections import deque -from collections import defaultdict -import bisect +from itertools import combinations, permutations, accumulate, product  # (string,3) 3回 +# from collections import deque +from collections import deque, defaultdict, Counter +import decimal +import re + +# import bisect +# my_round_int = lambda x:np.round((x*2 + 1)//2) +# 四捨五入g - - +# mod = 9982443453 -def main(): -    n = int(eval(input())) -    # 一番大きいものは何か、それを保存してdfs -    def dfs(cnt, s): -        if cnt == n: -            print(s) -            return -        biggest = "a" -        c = 0 -        while c < len(s): -            if s[c] == biggest: -                biggest = chr(ord(biggest) + 1) -                c += 1 -            else: -                c += 1 -        for i in range(0, ord(biggest) - ord("a") + 1): -            sc = chr(ord("a") + i) -            s += sc -            dfs(cnt + 1, s) -            s = s[:-1] - -    dfs(0, "") +def I(): +    return int(input()) -if __name__ == "__main__": -    main() +n = I() +ans = ["a"] +for i in range(n - 1): +    tmp = [] +    for s in ans: +        m = max(s) +        j = ord(m) - ord("a") + 1 +        for k in range(j + 1): +            tmp.append(s + chr(ord("a") + k)) +    ans = tmp +print(*ans, sep="\n")