#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  queue<string> q;
  q.push("a");
  while (!q.empty()) {
    string now = q.front();
    q.pop();
    if (now.size() == n) {
      cout << now << endl;
      continue;
    }
    char bk = now.back();
    for (int i = 0; i < (int)(bk - 'a' + 2); i++) {
      string add = now;
      add.push_back(i + 'a');
      q.push(add);
    }
  }
  return 0;
}
