#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); }
const long long big = 1000000007;
int exp(int x, int y) {
  if (y == 0) return 1;
  if (x == 1 || x == 0) return x;
  if (y % 2 == 1) return (exp(x, y - 1) * x) % big;
  int t = exp(x, y / 2);
  return (t * t) % big;
}
void chmin(long long a, long long b) {
  if (a > b) a = b;
  return;
}
priority_queue<string, vector<string>, greater<string>> func(int n) {
  priority_queue<string, vector<string>, greater<string>> ans;
  if (n == 1) {
    ans.push("a");
    return ans;
  }
  priority_queue<string, vector<string>, greater<string>> last = func(n - 1);
  while (!last.empty()) {
    string now = last.top();
    last.pop();
    for (int i = 0; i < (int)(now[n - 2] - 'a' + 2); i++) {
      char k = 'a' + i;
      ans.push(now + k);
    }
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  priority_queue<string, vector<string>, greater<string>> ans = func(n);
  while (!ans.empty()) {
    cout << ans.top() << endl;
    ans.pop();
  }
}
