#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); ++i)
typedef long long ll;
string prev;
bool doukei(string next, string prev){
  //cout << 2 << endl;
  if(next.size()!=prev.size()) return false;
  rep(i,next.size()){
    for(ll j=i+1; j<next.size();j++){
      if(next[i]==next[j]&&prev[i]==prev[j]) continue;
      if(next[i]!=next[j]&&prev[i]!=prev[j]) continue;
      return false;
    }
  }
  return true;
}
  string s0 = "abcdefghij";
  void dfs(string s, ll n, ll cl){
    if(s.size()==n){
      cout << s << endl;
      prev = s;
    }else{
      for(ll i=0;i<cl;i++){
        string next=s+s0[i];
        ll nl = cl+1;
        if(doukei(next, prev)) return;
        dfs(next, n, nl);
      }
    }
  };
int main(){

  ll n; cin >> n;
  

  dfs("", n,1);
  

}