#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); }
priority_queue<string, vector<string>, greater<string>> f(int n) {
  priority_queue<string, vector<string>, greater<string>> a;
  if (n == 1) {
    a.push("a");
    return a;
  }
  priority_queue<string, vector<string>, greater<string>> mae = f(n - 1);
  while (!mae.empty()) {
    string s = mae.top();
    mae.pop();
    for (long long i = 0; i < (long long)(s[s.size() - 1] - 'a' + 2); i++) {
      char k = 'a' + i;
      a.push(s + k);
    }
  }
  return a;
}
int main() {
  int n;
  cin >> n;
  priority_queue<string, vector<string>, greater<string>> ans = f(n);
  while (!ans.empty()) {
    printf("%s\n", ans.top().c_str());
    ans.pop();
  }
}
