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<int[]>();
            var add = new int[N];
            add[0] = 1;
            stan.Add(add);
            for (int i = 1; i < N; i++)
            {
                var newS = new List<int[]>();
                foreach (var s in stan)
                {
                    var max = s.Max();
                    for (int j = 1; j <= max + 1; j++)
                    {
                        var tmp = new int[N];
                        Array.Copy(s, tmp, N);
                        tmp[i] = j;
                        newS.Add(tmp);
                    }
                }
                stan = newS;
            }
            var ans = new List<string>();
            foreach (var s in stan)
            {
                var tmp = "";
                foreach (var i in s)
                {
                    switch (i)
                    {
                        case 1:
                            tmp += "a";
                            break;
                        case 2:
                            tmp += "b";
                            break;
                        case 3:
                            tmp += "c";
                            break;
                        case 4:
                            tmp += "d";
                            break;
                        case 5:
                            tmp += "e";
                            break;
                        case 6:
                            tmp += "f";
                            break;
                        case 7:
                            tmp += "g";
                            break;
                        case 8:
                            tmp += "h";
                            break;
                        case 9:
                            tmp += "i";
                            break;
                        case 10:
                            tmp += "j";
                            break;
                        default:
                            break;
                    }
                }
                ans.Add(tmp);
            }
            ans.Sort();
            foreach (var a in ans) Console.WriteLine(a);

            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(); }
    }
}