#include <bits/stdc++.h>
using namespace std;
int main() {
  uint64_t N;
  cin >> N;
  queue<pair<string, uint64_t>> q;
  q.emplace("a", 1);
  while (!q.empty()) {
    pair<string, uint64_t> p = q.front();
    q.pop();
    string s = p.first;
    uint64_t k = p.second;
    if (s.size() == N) {
      cout << s << endl;
      continue;
    }
    for (uint64_t i = 0; i < k; ++i) {
      char c = 'a' + i;
      q.emplace(s + c, i + 1);
    }
    {
      char c = 'a' + k;
      q.emplace(s + c, k + 1);
    }
  }
  return 0;
}
