import sys
import re

l = sys.stdin.readline()
l = int(l)
out = []
def x(stri,l,depth):
  str = 'abcdefghij'
  for i in range(0,l-depth+1):
    cdepth = depth
    cstri = stri
    cstri += str[i] 
    cdepth -= 1
    if( cdepth == 0):
	out.append(cstri)
    else:
	x(cstri,l,cdepth)


stri = 'a'
if( l == 1):
 print stri
 exit(0)
x(stri,l,l-1)

ret = {}
count = 0
for i in out:
  prev = '0'
  moji = ""
  uniq = ""
  for j in i:
    if( prev == j ):
      moji += "E"
    else:
      if( j not in uniq ):
        uniq += j
      if( prev > j ):
        moji += "U"
      else:
        moji += "D"
    prev = j
  moji += str(len(uniq))
  if( moji not in ret.values()):
    print i
  ret[count] = moji
  count += 1

sys.stdout.flush()
