#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<std::string> ans;
  std::string allSame;
  for (int i = 0; i < N; i++) allSame += 'a';
  ans.push_back(allSame);
  for (int i = 0; i < N; i++) {
    auto base = ans.back();
    char ch = ans.back()[i] + 1;
    for (int j = N - 1; j >= i + 1; j--) {
      auto s = std::string(base);
      s[j] = ch;
      ans.push_back(s);
    }
  }
  for (const auto s : ans) {
    std::cout << s << "\n";
  }
  return 0;
}
