n = int(input())

def aa(nokori, str, nowID, firstID):
  if nokori == 1:
    print(str+chr(nowID))
    return
  for i in range(nowID - firstID + 2):
    aa(nokori-1, str+chr(nowID), firstID + i, firstID)
 
aa(n, "", 97, 97)