#include <bits/stdc++.h>
using namespace std;
int ar[32] = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
              1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int main() {
  queue<string> que;
  int n;
  cin >> n;
  que.push("a");
  for (int i = 2; i <= n; i++) {
    queue<string> nque;
    while (!que.empty()) {
      string s = que.front();
      que.pop();
      for (int c = 0; c < i; c++) {
        nque.push(s + (char)('a' + c));
      }
    }
    while (!nque.empty()) {
      que.push(nque.front());
      nque.pop();
    }
  }
  while (!que.empty()) {
    cout << que.front() << endl;
    que.pop();
  }
}
