#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
vector<vector<int> > V;
void rec(int rest, int pre, vector<int> v) {
  if (rest == 0) {
    V.push_back(v);
    return;
  }
  for (int i = 1; i <= rest; i++) {
    vector<int> vDash = v;
    if (i <= pre) {
      vDash.push_back(i);
      rec(rest - i, i, vDash);
    }
  }
}
int main() {
  int N;
  cin >> N;
  vector<int> v;
  rec(N, N + 1, v);
  vector<string> vs;
  for (auto v : V) {
    vector<char> vc;
    char a = 'a';
    for (int i = 0; i < v.size(); i++) {
      for (int j = 0; j < v[i]; j++) {
        vc.push_back('a' + i);
      }
    }
    string s = "";
    for (int i = 0; i < N; i++) {
      s += vc[i];
    }
    vs.push_back(s);
  }
  sort(vs.begin(), vs.end());
  for (auto s_ : vs) cout << s_ << '\n';
}
