#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  int n;
  cin >> n;
  queue<string> Q[15];
  Q[1].push("a");
  for (int i = 2; i <= n; ++i) {
    while (!Q[i - 1].empty()) {
      string s = Q[i - 1].front();
      for (int j = 0; j < i; ++j) {
        Q[i].push(s + (char)('a' + j));
      }
      Q[i - 1].pop();
    }
  }
  while (!Q[n].empty()) {
    string s;
    s = Q[n].front();
    cout << s << endl;
    Q[n].pop();
  }
}
