using System;
using System.Text;
using System.Collections.Generic;
using static System.Math;
using System.Linq;
using static System.Array;

namespace AtcoderExpress
{


    class Program
    {
        static List<string> ans;
        static List<string> avail;
        static void Main(string[] args)
        {
            var N = long.Parse(Console.ReadLine());

            ans = new List<String>();
            avail = new List<String>();
            for (int i = 0; i < N-1; i++)
            {
                var tmp = ((char)('a' + i)).ToString();
                avail.Add(tmp);
            }
            StringGenetater(N, "a");

            var tmp2 = ((char)('a' + N-1)).ToString();
            avail.Add(tmp2);
            string K = ""; 
            foreach (var item in avail)
            {
                K = K + item;
            }
            if(N > 1)
            {
                ans.Add(K);
            }
            
            foreach (var item in ans)
            {
                Console.WriteLine(item);
            }
            //Console.WriteLine(double.MinValue);
        }

        static void StringGenetater(long N,string str = "a")
        {
            if(N == 1)
            {
                ans.Add(str);
            }
            else
            {
                foreach (var item in avail)
                {
                    var tmp = str + item;
                    StringGenetater(N - 1, tmp);
                }
            }
        }
    }
}
