using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;

public static class P
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());

        Console.WriteLine(string.Join("\n", Solve(n).OrderBy(x => x)));
    }
    static IEnumerable<string> Solve(int n)
    {
        if (n == 1)
        {
            yield return "a";
            yield break;
        }
        foreach (var item in Solve(n - 1))
        {
            yield return "a" + item;
            yield return "a" + string.Join("", item.Select(x => (char)(x + 1)));
        }
    }
}
