#include <bits/stdc++.h>
using namespace std;
vector<string> c = {"a", "b", "c", "d", "e", "f", "g",
                    "h", "i", "j", "k", "l", "m"};
int main() {
  long long int N;
  cin >> N;
  vector<vector<int> > from(1);
  from[0] = {1};
  if (N == 1) {
    cout << "a" << endl;
    return 0;
  }
  vector<vector<int> > to = from;
  for (int n = 1; n <= N; n++) {
    from = to;
    to.erase(to.begin(), to.end());
    for (int i = 0; i < from.size(); i++) {
      vector<int> original = from[i];
      for (int j = 0; j < original.size(); j++) original[j]++;
      vector<int> rep = {1};
      for (int j = 0; j < original.size(); j++) rep.push_back(original[j]);
      to.push_back(rep);
      rep = {1};
      bool changed = false;
      for (int k = 2; k <= 10; k++) {
        for (int j = 0; j < original.size(); j++) {
          if (k == original[j]) {
            rep.push_back(1);
            changed = true;
            continue;
          }
          rep.push_back(original[j]);
        }
        if (changed) break;
        to.push_back(rep);
        rep = {1};
      }
    }
  }
  vector<string> S;
  for (int i = 0; i < to.size(); i++) {
    string s = "";
    for (int j = 0; j < to[j].size(); j++) {
      s += c[to[i][j] - 1];
    }
    S.push_back(s);
  }
  sort(S.begin(), S.end());
  for (int i = 1; i < S.size(); i++) {
    cout << S[i] << endl;
  }
  return 0;
}
