#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
using P = pair<T, U>;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
int main() {
  vec<string> ans = {"a", "b", "c", "d", "e", "f",
                     "g", "h", "i", "j", "k", "l"};
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  } else if (n == 2) {
    cout << "aa" << endl;
    cout << "ab" << endl;
    return 0;
  } else {
    queue<vec<int>> q;
    q.push(vec<int>(n, 0));
    while (true) {
      vec<int> tmp = q.front();
      q.pop();
      int idx = n;
      for (int(i) = 0; (i) < (n); (i)++) {
        if (tmp[n - 1 - i] != tmp[n - 2 - i]) continue;
        tmp[n - 1 - i]++;
        break;
      }
      for (int(i) = 0; (i) < (n); (i)++) cout << ans[tmp[i]];
      cout << endl;
      q.push(tmp);
      bool finish = true;
      for (int(i) = 0; (i) < (n); (i)++)
        if (tmp[i] != i) finish = false;
      if (finish == true) break;
    }
  }
}
