#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 {
      c[x] = 'a' + v;
      dfs(x + 1, v);
      if (x) {
        c[x] = 'a' + v + 1;
        dfs(x + 1, v + 1);
      }
    }
  };
  dfs(0, 0);
}
