#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T>
void view(const std::vector<T> &v) {
  for (const auto &e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv) {
  for (const auto &v : vv) {
    view(v);
  }
}
void rec(int k, string s) {
  if (k == 1) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i < s.at(s.size() - 1) - 'a' + 2; ++i) {
    char c = 'a' + i;
    string ss = string(1, c);
    rec(k - 1, s + ss);
  }
}
int main() {
  int n;
  cin >> n;
  rec(n, "a");
  return 0;
}
