#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;
  queue<string> a;
  priority_queue<string, vector<string>, greater<string>> ans;
  a.push("a");
  for (long long i = 1; i < (long long)(n - 1); i++) {
    int aa = a.size();
    queue<string> b;
    for (long long j = 0; j < (long long)(aa); j++) {
      string t = a.front();
      a.pop();
      char k = t[t.size() - 1];
      for (long long i = 0; i < (long long)(k - 'a' + 2); i++) {
        char s = 'a' + i;
        b.push(t + s);
      }
    }
    a = b;
  }
  int aa = a.size();
  for (long long j = 0; j < (long long)(aa); j++) {
    string t = a.front();
    a.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);
    }
  }
  while (!ans.empty()) {
    string out = ans.top();
    ans.pop();
    printf("%s\n", out.c_str());
  }
}
