#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
const long long int LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI = acos(-1.0L);
__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
signed main() {
  int n;
  cin >> n;
  queue<string> q;
  q.push("a");
  int cnt = 1;
  while (cnt < n) {
    for (int i = 0; i < (int)(pow(2, cnt - 1)); i++) {
      string tmp = q.front();
      q.pop();
      char last = tmp[cnt - 1];
      string f, s;
      f = tmp + last;
      last += 1;
      s = tmp + last;
      q.push(f);
      q.push(s);
    }
    cnt++;
  }
  for (int i = 0; i < (int)(pow(2, cnt - 1)); i++) {
    cout << q.front() << endl;
    q.pop();
  }
  return 0;
}
