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

public class P
{
    public string s { get; set; }
    public char mx { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        getAns(n);
    }
    static void getAns(int n)
    {
        var sb = new StringBuilder();
        var q = new Queue<P>();
        q.Enqueue(new P { s = "a", mx = 'a' });
        while (q.Count() > 0)
        {
            var w = q.Dequeue();
            if (w.s.Length == n) { sb.Append(w.s); sb.Append("\n"); }
            else
            {
                for (int i = 'a'; i <= w.mx+1; i++)
                    q.Enqueue(new P { s = w.s + (char)i, mx = w.mx });
            }
        }
        Console.Write(sb);
    }
}