/*
    Don’t practice until you get it right. Practice until you can’t get it wrong.
*/

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ld double
#define pii pair<ll,ll>
#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define vp vector<pii>
#define pb push_back
#define mp make_pair
#define sc(a) scanf("%lld",&a);
#define sd(a) scanf("%lf",&a);
#define test() ll tt;cin>>tt;for(ll testcase=1;testcase<=tt;testcase++)
#define all(v) v.begin(),v.end()
#define vivek_ghosh ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX 1000055
#define mod 1000000007
#define ff first
#define ss second
const int INF=0x3f3f3f3f;
const ll int inf = LLONG_MAX;

ll power(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return power((x*x)%M,n/2,M);
    else
        return (x*power((x*x)%M,(n-1)/2,M))%M;
}

ll modinv(ll a,ll m)
{
    ll g =__gcd(a, m);
    ll res=power(a, m-2, m);
    return res;
}

vb prime(MAX,true);
vl prm;
void sieve()
{
	prime[0] = prime[1] = false;
	for(ll p=2;p*p<MAX;p++)
	{
		if(prime[p])
		{
			for(ll i=p*p;i<MAX;i+=p)
				prime[i] = false;
		}
	}
	for(ll p=2;p<MAX;p++)
	{
		if(prime[p])
			prm.pb(p);
	}
}

set<string> ans;
string s;
void find(ll n, ll id)
{
    if(id == n)
    {
        ans.insert(s);
        return ;
    }
    for(ll i=0;i<id;i++)
    {
        s[id] = s[i];
        find(n,id+1);
        if(s[i] == 'a')
        {
            s[id] = 'b';
            find(n,id+1);
        }
        else
        {
            s[id] = 'a';
            find(n,id+1);
        }
    }

}

ll n,m,t,i,j,k,q,x,y,cnt=0,sum=0,mx=-1,mn=INT_MAX;

int main()
{
    vivek_ghosh;

    cin>>n;
    s.resize(n);
    s[0] = 'a';

    find(n,1);

    for(auto it:ans)
        cout<<it<<endl;

    return 0;
}






