#include <bits/stdc++.h>
using namespace std;
class DStringEquivalence {
 public:
  static void search(int n, vector<string> &vec) {
    if (n == 0) return;
    search(n + 1, vec);
  }
  static void solve(std::istream &cin, std::ostream &cout) {
    int n;
    cin >> n;
    vector<char> vec = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
    vector<string> ans;
    stack<string> stack;
    stack.push("a");
    if (n == 1) {
      cout << stack.top() << endl;
      return;
    }
    while (!stack.empty()) {
      string now = stack.top();
      stack.pop();
      set<char> s;
      for (const auto &item : now) s.insert(item);
      int index = s.size();
      for (int k = 0; k < index + 1; ++k) {
        string tmp = now + vec[k];
        if (tmp.size() > n)
          continue;
        else if (tmp.size() == n)
          ans.emplace_back(tmp);
        stack.push(tmp);
      }
    }
    sort(ans.begin(), ans.end());
    for (const auto &item : ans) {
      cout << item << endl;
    }
  }
};
int main() {
  DStringEquivalence solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
