#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
ans = []
def dfs(s,keta):
  if keta == n+1:
    for sude in ans:
      for i in range(n-1):
        for j in range(i+1,n):
          if not ((sude[i] == sude[j] and s[i] == s[j]) or (sude[i] != sude[j] and s[i] != s[j])):
            return
    ans.append(s)
  else:
    for i in range(keta):
      dfs(s+chr(ord("a")+i),keta+1)

dfs("",1)
ans.sort()
print(*ans,sep = "\n")
  
