#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  function<void(int, int, string)> dfs = [&](int d, int p, string s) {
    if (d == n) {
      ans.emplace_back(s);
      return;
    }
    dfs(d + 1, p, s + (char)('a' + p));
    dfs(d + 1, p + 1, s + (char)('a' + p + 1));
  };
  dfs(1, 0, "a");
  sort(ans.begin(), ans.end());
  for (auto& s : ans) {
    cout << s << '\n';
  }
  return 0;
}
