#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<LL, LL>;
using VI = vector<int>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VVI = vector<VI>;
const LL LINF = 1001002003004005006ll;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void solve() {
  int N;
  cin >> N;
  string S = "abcdefghij";
  vector<pair<string, int>> V[11];
  V[0].push_back(make_pair("a", 0));
  for (int n = (1); n <= (N - 1); n++) {
    cerr << "step=" << n << endl;
    for (int i = 0; i < (V[n - 1].size()); ++i) {
      string old = V[n - 1][i].first;
      int jmax = V[n - 1][i].second;
      for (int j = 0; j < (jmax + 2); ++j) {
        string tmp;
        tmp = old + S.substr(j, 1);
        V[n].push_back(make_pair(tmp, j));
        cerr << tmp << endl;
      }
    }
  }
  cerr << "answer" << endl;
  for (int i = 0; i < (V[N - 1].size()); ++i) {
    cout << V[N - 1][i].first << endl;
  }
  return;
}
int main() {
  int T = 1;
  for (int i = 0; i < T; ++i) {
    solve();
  }
  return 0;
}
