#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  queue<string> que;
  que.push("a");
  while (1) {
    bool f = false;
    string v = que.front();
    int size = v.size();
    if (size == n - 1) f = true;
    que.pop();
    for (int i = 0; i < (int)(v.size() + 1); i++) {
      char a = 'a' + i;
      string t = v + a;
      que.push(t);
    }
    if (f) break;
  }
  while (!que.empty()) {
    cout << que.front() << endl;
    que.pop();
  }
}
