using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var N = Sarray()[0];
            var q = new Queue<Tuple<string, long>>();
            q.Enqueue(Tuple.Create("a", 1L));
            while (true) 
            {
                var d = q.Dequeue();
                var lst = d.Item2 + 1;
                var c = d.Item1[0];
                for (var j = 0; j < lst; ++j)
                {
                    var nextq = Tuple.Create(d.Item1 + ((char)(c + j)).ToString(), (long)(j + 1));
                    q.Enqueue(nextq);
                }
                if (lst == N)
                    break;
            }
            foreach (var d in q)
                WriteLine(d.Item1);
            Out.Flush();
        }
    }
}