#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long double eps = 1.0e-10;
int main() {
  int n;
  cin >> n;
  string s;
  for (int(i) = 0; (i) < (n); (i)++) {
    s.push_back('a');
  }
  cout << s << endl;
  char m = 'b';
  int c = 1;
  while (c <= n) {
    int count = c;
    while (count <= n) {
      for (int i = n - 1; count <= i; i--) {
        char x = s[i];
        s[i] = m;
        cout << s << endl;
        s[i] = x;
      }
      s[count] = m;
      count++;
    }
    c++;
    m++;
  }
}
