#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> w;
  string a;
  for (int i = 0; i < N; i++) {
    a += 'a';
  }
  char c;
  for (; a[0] == 'a';) {
    w.push_back(a);
    cout << a << endl;
    a[N - 1]++;
    for (int j = N - 1; j > 0; j--) {
      if (a[j - 1] + 2 <= a[j]) {
        a[j] = 'a';
        a[j - 1]++;
      }
    }
  }
  return 0;
}
