#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

llong N;

void solve(int now, vector<int> &v) {
  if (now == N) {
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < v[i + 1] - v[i]; ++j) {
        cout << char{'a' + i};
      }
    }
    cout << endl;
    return;
  }

  if (v.back() == N) {
    v.push_back(N);
    solve(now + 1, v);
    v.pop_back();
    return;
  }
  else {
    for (int i = N; i >= v.back() + 1; --i) {
      v.push_back(i);
      solve(now + 1, v);
      v.pop_back();
    }
  }

  return;
}

int main() {
  cin >> N;
  vector<int> v = {0};
  solve(0, v);

  return 0;
}