#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  string c(n, '0');
  function<void(int, int)> dfs;
  dfs = [&](int x, int v) {
    if (x == n)
      cout << c << endl;
    else
      for (int i = v; i != x + 1; i++) {
        c[x] = 'a' + i;
        dfs(x + 1, i);
      }
  };
  dfs(0, 0);
}
