#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb(x) push_back(x);
#define mp(x,y) make_pair(x,y)
#define X first
#define Y second
typedef long long int ll;
typedef pair<ll,ll> pp;

#define debug(x) cout << #x << " :: "<< x <<"\n";
#define debug2(x,y) cout << #x << " :: "<< x << "\t" << #y << " :: " << y << "\n";
#define debug3(x,y,z) cout << #x << " :: "<< x << "\t" << #y << " :: " << y << "\t" << #z << " :: " << z << "\n";
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree< pair<ll,ll> , null_type,less< pair<ll,ll> >, rb_tree_tag,tree_order_statistics_node_update>

int main()
{
    boost
    ll n;
    cin >> n;
    string s;
    for(ll i=0;i<n;i++) {
        s+=('a');
    }
    set<string> ans;
    s.erase(0,1);
    ll m=n-1;
    for(ll i=0;i<(1<<m);i++)    {
        string s1=s;
        for(ll j=0;j<32;j++)    {
            if( i&(1<<j) )  {
                s1[j]='b';
            }
        }
        s1.insert(0,"a");
        ans.insert(s1);
    }
    for(auto itr=ans.begin();itr!=ans.end();itr++)  {
        cout << *itr << "\n" ;
    }
    return 0;
}
