using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class MainClass
{
    static void Main()
    {
        int N = int.Parse(ReadLine());
        var S = new char[N];
        for (int i = 0; i < N; i++)
        {
            S[i] = 'a';
        }
        WriteLine(string.Join("",S));
        for (int i = 0; i < N-1; i++)
        {
            char c = (char)('a' + i + 1);
            var nS = new char[N];
            for (int j = 1; j < (1<<(N-1-i)); j++)
            {
                Array.Copy(S, nS, N);
                for (int k = 0; k < N-i; k++)
                {
                    if((j&(1<<k))>0)
                    nS[N - 1 - k] = c;
                }
                WriteLine(string.Join("",nS));
            }
            S = nS;
        }
        
    }

}
