#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  def dfs(s):
    if len(s) == n:
      print(s)
      return
    for i in range(ord('a'), ord(s[-1])+2):
      dfs(s + chr(i))
  dfs('a')
      
if __name__=='__main__':
  main()

