using System;
using System.Collections.Generic;
using System.Text;
using CompLib.Util;

public class Program
{
    List<string> l = new List<string>();
    List<int[]> ll = new List<int[]>();
    private int N;

    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();

        // n個の切り分け方のパターン

        S1(0);

        foreach (int[] ints in ll)
        {
            S(ints);
        }

        l.Sort(StringComparer.Ordinal);


        Console.WriteLine(string.Join("\n", l));
    }

    Stack<int> s = new Stack<int>();

    void S1(int i)
    {
        if (i >= N)
        {
            ll.Add(s.ToArray());
        }

        for (int j = i + 1; j <= N; j++)
        {
            s.Push(j - i);
            S1(j);
            s.Pop();
        }
    }

    void S(int[] ints)
    {
        if (ints.Length == 1)
        {
            l.Add(new string('a', N));
            return;
        }

        for (int k = 2; k <= ints.Length; k++)
        {
            // abab... cdef
            var sb = new StringBuilder();
            int nokori = ints.Length - k;

            for (int i = 0; i < ints.Length - nokori; i++)
            {
                if (i % 2 == 0)
                {
                    sb.Append(new string('a', ints[i]));
                }
                else
                {
                    sb.Append(new string('b', ints[i]));
                }
            }

            for (int i = 0; i < nokori; i++)
            {
                sb.Append(new string((char) ('c' + i), ints[i+ints.Length - nokori]));
            }
            l.Add(sb.ToString());
        }
    }


    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}