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

namespace AtCoders {
	class Program {
		static void Main(string[] args) {
	

			var inputArray = retreiveIntArray();
			var inputCount = 1;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			var N = inputArray[0];

			//答えの出力
			var ans = getAns(N);
			foreach (var mojiretu in ans) {
				Console.WriteLine(mojiretu);

			}

		}

		private static string[] getAns(int N) {

			string[] characters= { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
			var ans = new List<string> {
				characters[0]
			};
			for (int i = 1; i < N; i++) {
				var newAns = new List<string>();
				foreach (var mojiretu in ans) {
					for (int n = 0; n <= i; n++) {
						newAns.Add(mojiretu + characters[n]);
					}
				}
				ans = newAns;
			}

			return ans.ToArray();
		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray =  Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static int[] retreiveIntArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var intArray = inputArray.Select(s => int.Parse(s));
			return intArray.ToArray();
		}
	}
}
