#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  string s(n, 'a');
  cout << s << '\n';
  string ss = s;
  for (int i = 1; i < n; ++i) {
    for (int bit = 1; bit < (1 << (n - i)); bit++) {
      ss = s;
      for (int k = 0; k < n - i; ++k) {
        if (bit & (1 << k)) ss[n - k - 1] += 1;
      }
      cout << ss << '\n';
      if (bit == (1 << (n - i)) - 1) s = ss;
    }
  }
  return 0;
}
