#include "stdafx.h"
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define mmod 998244353
#define all(v) v.begin(), v.end()
using namespace std;
int mypow(int a, int b, int c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	int z = mypow(a, b / 2, c);
	return z * z%c;
}
void mutu(int n,int z,string s) {
	if (n == 0) {
		cout << s << endl;
		return;
	}
	else {
		f(i, z + 2) {
			mutu(n - 1, i,s+char('a'+i));
		}
	}
}
signed main() {
	int n;
	cin >> n;
	mutu(n - 1, 0, "a");
}
