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

namespace AC
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt();
            var stan = new List<string>();
            stan.Add("a");
            var chk = 'a';
            for (int i = 2; i <= N; i++)
            {
                var plusS = new List<string>();
                chk++;
                foreach(var s in stan)
                {
                    for (char c = 'a'; c <= chk; c++)
                    {
                        plusS.Add(s + c.ToString());
                    }
                }
                stan = plusS;
            }
            stan.Sort();
            foreach (var s in stan) Console.WriteLine(s);

            Console.WriteLine();
            Console.ReadKey();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static string[] ReadArrayString() { return Read().Split(' '); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}