#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18L + 1;
int main() {
  int n;
  cin >> n;
  for (int i = (1 << n) - 1; i >= 1 << (n - 1); i--) {
    string str(n, 'a');
    int count = 1;
    for (int j = 0; j < n; j++) {
      if (1 & (i >> j)) {
        str[n - j - 1] = 'a';
      } else {
        str[n - j - 1] = 'a' + count;
        count++;
      }
    }
    cout << str << endl;
  }
  return 0;
}
