#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n + 1);
  long long time = 1;
  for (long long i = 0; i < n; i++) {
    time *= 2;
  }
  for (long long i = 0; i < time / 2; i++) {
    for (long long j = 1; j < a.size(); j++) {
      cout << (char)('a' + a.at(j));
    }
    cout << endl;
    a.at(a.size() - 1)++;
    for (long long j = a.size() - 1; j >= 1; j--) {
      if (a.at(j) == 2) {
        a.at(j) = 0;
        a.at(j - 1)++;
      }
    }
  }
}
