using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace AtCoder {
	class Program {
		public static void Main(string[] args) {
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
			
			int n = int.Parse(Console.ReadLine());
			List<string> list = new List<string> { "a"};
			for (int i = 1; i < n; i++) {
				for(int j = 0; j < list.Count; j++) {
					if (list[j].Length == i) {
						char last = list[j].Last();
						list.Insert(j + 1, list[j] + last.ToString());
						list.Insert(j + 2, list[j] + ((char)(last+1)).ToString());
					} else {
						list.RemoveAt(j-1);
					}
				}
			}
			Console.WriteLine(string.Join("\n", list));

			Console.Out.Flush();
		}
	}
}
