/* ****TCIITB**** */

#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

#define N  100005

int main()
{
	
	io
	
	ll n;
	cin>>n;
	
	std::vector<std::vector<ll> > v1;
	rep(i,0,(1<<(n-2)))
	{
		ll z=i;
		std::vector<ll> tmp;

		while(z)
		{
			tmp.pb(z%2);
			z/=2;
		}
		ll diff=n-1-tmp.size();
		rep(j,0,diff)
		tmp.pb(0);		
		reverse(all(tmp));
		v1.pb(tmp);
	}
	sort(all(v1));
	std::vector<string> res1;
	for(auto i:v1)
	{
		string z="";
		rep(j,0,i.size())
		{
			z+=char('a'+i[j]+1);
		}
		res1.pb(z);		
	}
	// if(n>=3)
	// {
	// 	string z="";
	// 	rep(i,0,n)
	// 		{
	// 			z+=char('a'+i);				
	// 		}
	// // cout<<z<<endl;
	// 	res.pb(z);
	// }
	// // rep(i,0,res.size())
	// // cout<<res[i]<<endl;
	ll vis1[res1.size()]={0};
	rep(i,0,res1.size())
	{
		rep(j,i+1,res1.size())
		{
			string tmp1=res1[i];
			string tmp2=res1[j];
			ll fl=1;
			rep(k,0,n)
			{
				rep(l,k+1,n)
				{
					if((tmp1[k]==tmp1[l] && tmp2[k]==tmp2[l]) || (tmp1[k]!=tmp1[l] && tmp2[k]!=tmp2[l]))
					{
						continue;
					}
					else
					{
						fl=0;
					}
					
				}
			}
			if(fl)
			{
				if(tmp1<tmp2)
					vis1[j]=1;
				else
					vis1[i]=1;
			}
		}
	}
	sort(all(res1));

	std::vector<std::vector<ll> > v;
	rep(i,0,(1<<(n-1)))
	{
		ll z=i;
		std::vector<ll> tmp;

		while(z)
		{
			tmp.pb(z%2);
			z/=2;
		}
		ll diff=n-tmp.size();
		rep(j,0,diff)
		tmp.pb(0);		
		reverse(all(tmp));
		v.pb(tmp);
	}
	sort(all(v));
	std::vector<string> res;
	for(auto i:v)
	{
		string z="";
		rep(j,0,i.size())
		{
			z+=char('a'+i[j]);
		}
		res.pb(z);		
	}
	
	// // rep(i,0,res.size())
	// // cout<<res[i]<<endl;
	for(auto i:res1)
	{
		string tmp=i;
		tmp='a'+tmp;
		res.pb(tmp);
	}
	if(n>=3)
	{
		string z="";
		rep(i,0,n)
			{
				z+=char('a'+i);				
			}
	// cout<<z<<endl;
		res.pb(z);
	}
	ll vis[res.size()]={0};
	rep(i,0,res.size())
	{
		rep(j,i+1,res.size())
		{
			string tmp1=res[i];
			string tmp2=res[j];
			ll fl=1;
			rep(k,0,n)
			{
				rep(l,k+1,n)
				{
					if((tmp1[k]==tmp1[l] && tmp2[k]==tmp2[l]) || (tmp1[k]!=tmp1[l] && tmp2[k]!=tmp2[l]))
					{
						continue;
					}
					else
					{
						fl=0;
					}
					
				}
			}
			if(fl)
			{
				if(tmp1<tmp2)
					vis[j]=1;
				else
					vis[i]=1;
			}
		}
	}

	sort(all(res));
	set<string> resfin;
	for(auto i:res)
	{
		resfin.insert(i);
	}
	for(auto i:resfin)
	{
		cout<<i<<endl;
	}


	
}