#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
signed main() {
  long long n;
  cin >> n;
  queue<string> que;
  long long count = 1;
  long long num = 1;
  que.push("");
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < num; j++) {
      string key = que.front();
      que.pop();
      for (long long s = 0; s < count; s++) {
        que.push(key + (char)('a' + s));
      }
    }
    count++;
    num *= i + 1;
  }
  while (que.size() > 0) {
    cout << que.front() << endl;
    que.pop();
  }
}
