#include <bits/stdc++.h>
using ll = unsigned long long;
using mymap = std::map<std::pair<char, int>, std::vector<std::string>>;
mymap memo;
std::vector<std::string> f(char c, char max_c, int depth) {
  if (depth == 1) {
    std::string s;
    s.push_back(c);
    return std::vector<std::string>{s};
  }
  std::vector<std::string> v;
  max_c = std::max<int>(max_c, c + 1);
  for (char i = 'a'; i <= c + 1; i++) {
    for (std::string s : f(i, max_c, depth - 1)) {
      v.push_back(c + s);
    }
  }
  return v;
}
int main() {
  int N;
  std::cin >> N;
  std::vector<std::string> ans = f('a', 'a', N);
  for (const std::string &s : ans) {
    std::cout << s << std::endl;
  }
}
