#include <bits/stdc++.h>
using namespace std;
using ull_t = unsigned long long;
int main() {
  int n;
  cin >> n;
  string s(n, 'a');
  cout << s << endl;
  function<bool(int i, int j)> proc;
  proc = [&](int i, int j) {
    ++s[j];
    char c = 'a';
    for (int k = 1; k < j; ++k) c = max(c, s[k]);
    if (s[j] > c + 1) {
      s[j] = 'a';
      if (i == j) return false;
      return proc(i, j - 1);
    } else
      return true;
  };
  for (int i = n - 1; i > 0; --i) {
    ++s[i];
    cout << s << endl;
    if (i < n - 1)
      while (proc(i, n - 1)) cout << s << endl;
  }
}
