#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001001001001001;
const int MOD = 1000000007;
template <typename T>
void print(const T &v);
int main() {
  int n;
  cin >> n;
  set<string> origin;
  origin.insert("a");
  for (int i = 1; i < n; i++) {
    set<string> list;
    for (auto str : origin) {
      for (int j = 0; j < str.size(); j++) {
        string ma = "";
        string mb = "";
        for (int k = 0; k < str.size(); k++) {
          ma.push_back(str[k]);
          mb.push_back(str[k]);
          if (j == k) {
            ma.push_back('a');
            mb.push_back('b');
          }
        }
        list.insert(ma);
        list.insert(mb);
      }
    }
    origin = list;
  }
  for (string l : origin) {
    cout << l << endl;
  }
  return 0;
}
template <typename T>
void print(T const &v) {
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ' ';
    cout << v[i];
  }
  cout << endl;
};
