#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int f = 1;
  char c[n];
  c[0] = 'a';
  for (int i = 1; i < n; i++) c[i] = c[i - 1] + 1;
  vector<string> d;
  while (f) {
    string s = c;
    d.push_back(s);
    int count = 0;
    for (int i = n - 1; i > 0; i--) {
      if (c[i] != c[i - 1]) {
        c[i] = c[i] - 1;
        break;
      } else
        count++;
    }
    if (count == n - 1) break;
  }
  int l = d.size();
  for (int i = 0; i < l; i++) {
    string s = d.back();
    cout << s.erase(n) << endl;
    d.pop_back();
  }
  return 0;
}
