#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  int c;
  cin >> n;
  string outp;
  for (int i = 0; i < (n); i++) outp.push_back('a');
  while (outp < "abcdefghijk") {
    c = 1;
    for (int i = 0; i < (n - 1); i++) {
      if (outp[i + 1] - outp[i] > 1) c *= 0;
    }
    if (c) cout << outp << endl;
    outp[n - 1]++;
    for (int i = 0; i < (n - 1); i++) {
      if (outp[n - 1 - i] - 'a' > n - 1 - i) {
        outp[n - 1 - i] = 'a';
        outp[n - 2 - i]++;
      }
    }
  }
  return 0;
}
