/*
  AUTHOR:SOURABH
  CREATED:14:03:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<pll , null_type, less< pll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen(2 "out.txt","w",stdout);

    ll t,n,i,j,k;
    char c;
    string s;
    set<string> b;
    set<string>::iterator it;
    t=1;
    //cin>>t;
    W(t--)
    {
        cin>>n;
        vll v;
        fs(i,1,1LL<<n)
        {
            s="";
            fn(j,n)
            s+='0';

            fn(j,n)
            {
                if(i & (1LL<<j))
                v.pb(j);
            }

            k=v.size();
            c='a';

            fn(j,v[0])
            {
                s[j]=c;
                c++;
            }
            fn(j,k)
            {
                s[v[j]]=c;
            }
            c++;
            fs(j,v[0]+1,n)
            {
                if(s[j]=='0')
                {
                    s[j]=c;
                    c++;
                }
            }

            b.insert(s);
            v.clear();

        }
        fit(it,b)
        cout<<*it<<"\n";
    }
    return 0;
}




