import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**5)

N = int(input())

def rec(i, m, ar) :
  if i == N :
    print(''.join(chr(s + 97) for s in ar))
    return 
  for j in range(min(m + 1, N)) :
    rec(i + 1, j + 1, ar + [j])


rec(0, 0, [])