#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  deque<string> a, b;
  a.push_back("a");
  int i = 1;
  while (i < n) {
    while (a.size() > 0) {
      string s = a.front();
      for (int j = 0; j < (s.size() + 1); j++) {
        if (j - (s[s.size() - 1] - 'a') > 1) continue;
        b.push_back(s + (char)('a' + j));
      }
      a.pop_front();
    }
    a = b;
    b.erase(b.begin(), b.end());
    i++;
  }
  for (auto p : a) cout << p << endl;
  return 0;
}
