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

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

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

        Search(0, 'a', "");
        l.Sort(StringComparer.Ordinal);
        Console.WriteLine(string.Join("\n", l));
    }

    void Search(int index, char c, string s)
    {
        if (index >= N)
        {
            l.Add(s);
            return;
        }

        for (int i = index + 1; i <= N; i++)
        {
            Search(i, (char) (c + 1), s + new string(c, i - index));
        }
    }

    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();
    }
}