using System;
using System.Linq;
using System.Collections.Generic;

namespace PANASONIC2020
{
    class D
    {
        static List<string> list;
        static int N;
        static void Main(string[] args)
        {
            N = int.Parse(Console.ReadLine());
            list = new List<string>();

            DFS("", 'a');
        }

        static void DFS(string S, char mx)
        {
            if (S.Length == N)
            {
                Console.WriteLine(S);
            }
            else
            {
                int count = 0;
                for (char c = 'a'; c <= mx; count++, c++)
                {
                    DFS(S + c, (char)(mx + 1));
                }

            }

        }
    }
}
