#include <bits/stdc++.h>
std::vector<std::string> solv(int N) {
  if (N == 1) return {"a"};
  if (N == 2) return {"aa", "ab"};
  auto const& rec = solv(N - 1);
  std::vector<std::string> ret;
  ret.reserve(rec.size() * 2 + N);
  for (auto const& s : solv(N - 1)) {
    ret.push_back('a' + s);
  }
  for (auto& s : solv(N - 1)) {
    s[0] = 'b';
    ret.push_back('a' + s);
  }
  if (N == 3) ret.push_back("abc");
  if (N >= 4) {
    std::string s;
    for (char c = 'a'; c < 'a' + N; c++) s.push_back(c);
    for (char c = 'a'; c < 'a' + N; c++) {
      s[N - 1] = c;
      ret.push_back(s);
    }
  }
  return ret;
}
int main() {
  int N;
  std::cin >> N;
  for (auto const& s : solv(N)) {
    std::cout << s << '\n';
  }
  return 0;
}
