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

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

