#include <bits/stdc++.h>
int main() {
  unsigned long long N;
  std::cin >> N;
  auto dict = "abcdefghij";
  std::vector<std::string> t[N];
  t[0].emplace_back("a");
  for (auto i = 0; i < N - 1; ++i) {
    t[i + 1].reserve(t[i].size() * N);
    for (auto v : t[i]) {
      for (auto j = 0; j <= i + 1; ++j) {
        t[i + 1].push_back(v + dict[j]);
      }
    }
  }
  for (auto v : t[N - 1]) {
    std::cout << v << std::endl;
  }
  return 0;
}
