#include <bits/stdc++.h>
using namespace std;
set<string> ret;
void dfs(vector<int>& v, int ii, int N, int prev) {
  if (N == 0) {
    vector<int> w;
    for (int i = (0); i < (int)(v.size()); i++) {
      if (v[i] == 0) continue;
      w.push_back(v[i]);
    }
    sort((w).begin(), (w).end());
    do {
      string s;
      for (int i = (0); i < (int)(w.size()); i++) {
        for (int j = (0); j < (int)(w[i]); j++) s += (char)('a' + i);
      }
      ret.insert(s);
    } while (next_permutation((w).begin(), (w).end()));
    return;
  }
  for (int i = (1); i < (int)(min(N + 1, prev + 1)); i++) {
    v[ii] = i;
    dfs(v, ii + 1, N - i, min(prev, i));
    v[ii] = 0;
  }
}
int main() {
  int N;
  cin >> N;
  vector<int> v(N + 1, 0);
  dfs(v, 0, N, N);
  for (__typeof((ret).begin()) it = (ret).begin(); it != (ret).end(); ++it) {
    cout << (*it) << endl;
  }
  return 0;
}
