#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "{";
  for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
vector<string> merge(int d, vector<string> &vec) {
  if (d <= 0) return vec;
  vector<string> nvec(0);
  for (string x : vec) {
    nvec.push_back(x + (char)x[x.size() - 1]);
    nvec.push_back(x + (char)(x[x.size() - 1] + 1));
  }
  vec = merge(d - 1, nvec);
  return vec;
}
int main() {
  int n;
  cin >> n;
  vector<string> vec = {"a"};
  vec = merge(n - 1, vec);
  for (auto x : vec) cout << x << "\n";
}
