#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char sa[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
  string ansstring(n, 'a');
  vector<int> ans(n, 0);
  int sento = 0;
  int matu = n - 1;
  int maxc = 0;
  if (n == 1) cout << 'a' << endl;
  while (sento != matu) {
    maxc = ans[matu];
    matu = n - 1;
    cout << ansstring << endl;
    while (ans[matu] != (maxc + 1)) {
      ans[matu]++;
      ansstring[matu] = sa[ans[matu]];
      cout << ansstring << endl;
    }
    matu--;
    while (ans[matu - 1] == ans[matu] - 1) matu--;
    ans[matu]++;
    ansstring[matu] = sa[ans[matu]];
    for (int i = matu + 1; i < n; i++) {
      ans[i] = 0;
      ansstring[i] = sa[0];
    }
  }
  return 0;
}
