#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  long long N;
  cin >> N;
  if (N >= 4) {
    return 0;
  }
  queue<string> Q;
  Q.push("a");
  string s = "a";
  for (long long i = 1; i < N; i++) {
    vector<string> res;
    while (!Q.empty()) {
      string s = Q.front();
      Q.pop();
      res.push_back(s + "a");
      res.push_back(s + "b");
    }
    for (long long j = 0; j < (long long)res.size(); j++) {
      Q.push(res[j]);
    }
    s += (char)('a' + i);
  }
  vector<string> ans;
  while (!Q.empty()) {
    ans.push_back(Q.front());
    Q.pop();
  }
  ans.push_back(s);
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  for (long long i = 0; i < (long long)ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
