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

namespace test
{
    class Program
    {
        private static string[] _target;
        static void Main(string[] args)
        {
            var N = Console.ReadLine().ToInt();
            _target = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
            var s = new string[N];
            Create(s, 0, N);
            Console.ReadLine();
        }

        private static void Create(string[] s, int currentNum, int N)
        {
            if (currentNum == N)
            {
                Console.WriteLine(string.Join(string.Empty, s));
                return;
            }
            for (int i = 0; i <= currentNum; i++)
            {
                s[currentNum] = _target[i];
                Create(s, currentNum + 1, N);
            }
        }
    }

    public static class Extensions
    {
        public static int ToInt(this object str)
        {
            return int.Parse(str.ToString());
        }

        public static decimal ToDecimal(this object str)
        {
            return decimal.Parse(str.ToString());
        }
    }
}
