#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MAX=1e18;
ll mod=998244353;
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
#define endl '\n'
#define pb push_back
#define se second
#define fi first
#define maxe max_element
#define mine min_element
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define boost  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

long long expo(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return expo((x*x)%M,n/2,M)%M;
    else                             //n is odd
        return (x*expo((x*x)%M,(n-1)/2,M))%M;

}
vector<string> v[11];

void solve()
{
  ll n;
  cin>>n;
  v[1].pb("a");
  v[2].pb("aa");v[2].pb("ab");
  for(int i=3;i<=11;i++)
  {
      ll t=0;
      for(int j=0;j<(pow(2,i-1)-1);j++)
      {
          string s="";
          for(int k=0;k<i;k++)
          {
              if(t>>k&1)
              {
                  s='b'+s;
              }
              else
                s='a'+s;
          }
          t++;
          //debug2(i,s);
          v[i].pb(s);
      }
      string di="a";
      for(int j=0;j<v[i-1].size();j++)
      {
          di="a";
          string ma=v[i-1][j];
          for(int k=0;k<ma.length();k++)
          {
              ll dd=(ma[k]-'a');
              char c=('a'+dd+1);
              ma[k]=c;
          }
          di=di+ma;
          v[i].pb(di);
      }
  }
  for(int i=0;i<v[n].size();i++)cout<<v[n][i]<<endl;

}

int main(){
    boost;
  solve();
}
