#include <bits/stdc++.h>
using namespace std;
void logf(istream_iterator<string> it) {}
template <typename T, typename... Args>
void logf(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  logf(++it, args...);
}
const double PI = acos(-1);
void solve() {
  int n;
  cin >> n;
  ;
  vector<string> ans;
  function<void(int, string)> nf = [&](int len, string pre) {
    if (len == 0) {
      ans.push_back(pre);
      return;
    }
    char c = 'a';
    if (pre.size() > 0) c = pre.back() + 1;
    string s;
    for (int i = 0; i < len; i++) {
      s += c;
      nf(len - i - 1, pre + s);
    }
  };
  nf(n, "");
  for (int i = ans.size() - 1; i >= 0; i--) cout << ans[i] << endl;
}
int main() {
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  solve();
}
