#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  auto s = string(n, 'a');
  do {
    cout << s << "\n";
    for (int i = n - 1; i >= 0; i--) {
      s[i]++;
      if (s[i] <= 'a' + i) {
        break;
      } else if (i > 0) {
        s[i] = 'a';
      } else {
        break;
      }
    }
    cerr << "done" << s << "\n";
  } while (s[0] == 'a');
  return 0;
}
