#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  ans.push_back("a");
  for (int i = 1; i < n; i++) {
    vector<string> next;
    for (auto s : ans) {
      next.emplace_back(s + s[s.size() - 1]);
      set<char> sc;
      for (auto c : s) {
        sc.emplace(c);
      }
      next.emplace_back(s + char('a' + sc.size()));
    }
    ans = next;
  }
  for (auto a : ans) {
    cout << a << endl;
  }
  return 0;
}
