#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
//#define int long long
using namespace __gnu_pbds;
using namespace std;

int n;

signed main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	vector<string> v;
	for(int i=0;i<(1<<(n-1));i++){
		int cnt=1;
		string s="";
		s+='a';
		for(int j=1;j<n;j++){
			if(!(i&(1<<(j-1)))){
				cnt=0;s+='a';
				cnt++;
			}
			else{
				s+=char(cnt+'a');
				cnt++;
			}
		}
		v.push_back(s);
	}
	sort(v.begin(),v.end());
	for(int i=0;i<v.size();i++){
		cout<<v[i]<<endl;
	}
	return 0;
}