#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  string p;
  cin >> n;
  string ar[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  deque<string> q;
  q.push_back("a");
  for (i = 1; i < n; i++) {
    while (q.front().length() <= i) {
      p = q.front();
      q.pop_front();
      for (j = 0; j <= i; j++) {
        if (ar[j][0] - p[i - 1] <= 1) q.push_back(p + ar[j]);
      }
    }
  }
  for (auto l : q) cout << l << "\n";
}
