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

class Program
{
    static void Main(string[] args)
    {
        var input = long.Parse(Console.ReadLine());
        long ans = 0;

        long before = 0;
        long beforeAll = 0;
        long num = 0;

        var lastNum = new List<long>();
        var lastAnswerList = new List<string>();
        var array = new string[10] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };

        for (var i = 1; i < input + 1; i++)
        {
            var nums = new List<long>();
            var answerList = new List<string>();
            var count = 0;
            if (i != 1) 
            {
                foreach (var str in lastAnswerList)
                {
                    for (var j = 0; j < lastNum[count] + 2; j++)
                    {
                        answerList.Add(str + array[j]);
                        nums.Add(j);
                    }
                    count++;
                }
                lastNum = nums;
                lastAnswerList = answerList;
            }
            else
            {
                lastNum.Add(0);
                lastAnswerList.Add("a");
            }
        }
        foreach (var a in lastAnswerList)
        {
            Console.WriteLine(string.Join("", a));
        }
        Console.ReadKey();
    }
}