#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> cnt;
  vector<string> strs;
  for (int i = 0; i <= (1 << n); i++) {
    string cur = "";
    for (int j = 0; j < n; j++) {
      int l = (i >> j) & 1;
      cur += (l) ? "b" : "a";
    }
    strs.push_back(cur);
  }
  sort(strs.begin(), strs.end());
  for (int s = 0; s < strs.size(); s++) {
    string cur = "";
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        cur += (strs[s][i] == strs[s][j]) ? "a" : "b";
      }
    }
    if (!cnt.count(cur)) {
      cout << strs[s] << endl;
      cnt[cur] = 1;
    }
  }
  return 0;
}
