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

class Program
{
    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
        //MyDebugger.Test(process, "../TextFile2.txt");
        //MyDebugger.MakeTestCase("../TextFile2.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());

        var box = new List<string>() { "a" };
        var exist = new List<char>() { 'a' };

        func(box, exist, n - 1);

        var buil = new StringBuilder();
        foreach(var i in box) {
            buil.AppendLine(i);
        }

        return buil;
    }

    static void func(List<string> box, List<char> exists, int power) {
        if (power <= 0) return;

        var re = new List<string>();

        foreach(string s in box) {
            foreach(var c in exists) {
                re.Add(s + c.ToString());
            }
        }

        var newc = (char)(exists.Last() + 1);
        foreach (string s in box) {
            re.Add(s + newc.ToString());
        }
        exists.Add(newc);

        func(re, exists, power - 1);

        box.Clear();
        box.AddRange(re);
    }
}
