using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        private string Calc(int num, int digit)
        {
            int count = 0;
            var ret = string.Empty;
            for (var current = digit - 1; current >= 0; current--)
            {
                var bit = 1 << current;
                if ((num & bit) == bit)
                {
                    ret += (char)('a' + count);
                }
                else
                {
                    ret += (char)('a' + count++);
                }
            }

            return ret;
        }

        public void Solve()
        {
            var set = new SortedSet<string>();
            var N = int.Parse(Console.ReadLine());
            foreach (var num in Enumerable.Range(1, (int)Math.Pow(2, N)))
            {
                var text = Calc(num, N);
                if (text.Length == N)
                {
                    set.Add(text);
                }
            }

            foreach (var ans in set)
            {
                Console.WriteLine(ans);
            }
        }
    }
}
