#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int n;
int main() {
  cin >> n;
  string s;
  for (int i = 1; i <= n; i++) s.push_back('a');
  cout << s << endl;
  char c = 'a';
  for (int i = 1; i <= n - 1; i++) {
    ++c;
    int m = n - i;
    for (int j = 1; j < (1 << m); j++) {
      string t = s;
      for (int k = 0; k < m; k++)
        if (j >> k & 1) {
          t[n - k - 1] = c;
        }
      cout << t << endl;
    }
    for (int j = n - i; j >= i; j--) s[j] = c;
  }
  return 0;
}
