using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        private static CompareInfo ci = new System.Globalization.CultureInfo("ja-JP").CompareInfo;
        private static int Compare(string a, string b) { return ci.Compare(a, b, System.Globalization.CompareOptions.Ordinal); }

        static void Solve(int N, string S, char c, List<string> list)
        {
            for (char i = 'a'; i <= c; ++i)
            {
                string T = S + i;
                if (T.Length < N)
                {
                    Solve(N, T, (char)(i + 1), list);
                }
                else
                {
                    list.Add(T);
                }
            }
        }

        static void Main(string[] args)
        {
            int N = ReadInt();
            var list = new List<string>();
            Solve(N, "", 'a', list);
            foreach (var ans in list)
            {
                Console.WriteLine(ans);
            }
        }
    }
}
