#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(n, 0);
  string C = "abcdefghij";
  string s;
  int keta = n - 1;
  bool flug = 1;
  int f = 1;
  while (flug) {
    s = "";
    for (long long i = 0; i < (n); i++) {
      s += C[v[i]];
    }
    cout << s << endl;
    keta = n - 1;
    f = 0;
    while (v[keta - 1] + 1 == v[keta]) {
      keta--;
      f = 1;
    }
    if (f) {
      for (int i = keta + 1; i < n; i++) v[i] = 0;
    }
    v[keta]++;
    if (keta == 0 || v[0] > 0) flug = false;
  }
}
