#include <bits/stdc++.h>
using namespace std;
vector<string> ret;
void dfs(vector<int>& v, int ii, int N, int prev) {
  if (N == 0) {
    string s;
    for (int i = (0); i < (int)(v.size()); i++) {
      for (int j = (0); j < (int)(v[i]); j++) s += (char)('a' + i);
    }
    ret.push_back(s);
    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);
  sort((ret).begin(), (ret).end());
  for (int i = (0); i < (int)(ret.size()); i++) {
    cout << ret[i] << endl;
  }
  return 0;
}
