using System;
using System.Collections.Generic;
using System.Windows;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    public class Program
    {
        private static string[] _target;
        private static int N;
        static void Main(string[] args)
        {
            N = Console.ReadLine().ToInt();
            _target = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
            var s = new string[N];
            Create(0, 0, s);
            Console.ReadLine();
        }

        private static void Create(int currentNum, int useNum, string[] s)
        {
            if (currentNum == N)
            {
                Console.WriteLine(string.Join(string.Empty, s));
                return;
            }
            for (int i = 0; i <= useNum; i++)
            {
                s[currentNum] = _target[i];
                if (currentNum == 0 || s[currentNum - 1] != _target[i])
                {
                    Create(currentNum + 1, useNum + 1, s);
                }
                else
                {
                    Create(currentNum + 1, useNum, s);
                }
            }
        }
    }
}

public static class Extentions
{
    public static int ToInt(this object obj)
    {
        return int.Parse(obj.ToString());
    }

    public static decimal ToDecimal(this object obj)
    {
        return decimal.Parse(obj.ToString());
    }

    public static double ToDouble(this object obj)
    {
        return double.Parse(obj.ToString());
    }
}

