#include <bits/stdc++.h>
using namespace std;
long long max(long long x, long long y) {
  if (x > y)
    return x;
  else
    return y;
}
long long min(long long x, long long y) { return x + y - max(x, y); }
int main() {
  int n;
  cin >> n;
  priority_queue<string, vector<string>, greater<string>> ans;
  ans.push("a");
  for (long long i = 1; i < (long long)(n); i++) {
    while (1) {
      string t = ans.top();
      ans.pop();
      char k = t[t.size() - 1];
      for (long long i = 0; i < (long long)(k - 'a' + 2); i++) {
        char s = 'a' + i;
        ans.push(t + s);
      }
      int size = ans.top().size();
      if (size != i) break;
    }
  }
  while (!ans.empty()) {
    string out = ans.top();
    ans.pop();
    printf("%s\n", out.c_str());
  }
}
