#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int n;cin>>n;
	vector<vector<pair<string,int>>> v(12);
	v[1].pb(mp("a",0));
	for(int i = 2; i <= 10; i++) {
		for(int j = 0; j < v[i - 1].size(); j++) {
			for(int k = 0; k <= (v[i - 1][j]10.sc + 1); k++) {
				v[i].pb(mp(v[i - 1][j].fs + (char)('a' + k),max(v[i - 1][j].sc,k)));
			}
		}
	}
	for(int i = 0; i < v[n].size(); i++) {
		cout << v[n][i].fs << endl;
	}
	return 0;
}