#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> v;
  char a[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      v.push_back(a[i]);
    }
  }
  int b = 0;
  do {
    b++;
    for (int i = 0; i < n; i++) {
      cout << v[i];
    }
    cout << endl;
    if (b > (pow(n, 2) + 1) / 2) {
      break;
    }
  } while (next_permutation(v.begin(), v.end()));
  return 0;
}
