#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T &ans, T t) {
  if (t > ans) ans = t;
}
template <class T>
inline void chmin(T &ans, T t) {
  if (t < ans) ans = t;
}
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  map<vector<int>, bool> mp;
  for (int i = 0; i < (1 << n); ++i) {
    vector<int> bits(n), b(n);
    string s;
    for (int j = 0; j < n; ++j) {
      bits[j] = (i >> j) & 1;
      if (bits[j] == 0)
        b[j] = 1;
      else
        b[j] = 0;
      if (bits[j])
        s.push_back('b');
      else
        s.push_back('a');
    }
    if (mp[b])
      continue;
    else {
      mp[bits] = true;
      for (int k = 0; k < n; ++k) {
        if (s[k] == 'b') {
          for (int l = 0; l < n; ++l) {
            if (s[l] == 'b')
              s[l] = 'a';
            else
              s[l] = 'b';
          }
          break;
        } else {
          break;
        }
      }
    }
    ans.push_back(s);
  }
  sort(ans.begin(), ans.end());
  for (auto it : ans) {
    cout << it << endl;
  }
}
