import sys
import math
# import decimal
# import queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # queue
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def dfs(s,pos):
    global n
    if pos==n:
        print(s)
        return
    for i in range(ord('a'),ord('a')+pos+1):
        t = s
        t += chr(i)
        dfs(t,pos+1)

def main():
    global n
    n = int(input())
    dfs("",0)
    return

if __name__=='__main__':
    main()
