#include <bits/stdc++.h>
using namespace std;
template <typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const int INF = 1 << 29;
const long long INFL = 1LL << 60;
const long long mod = 998244353;
vector<vector<int>> w;
int k;
void f(int n, int cnt, vector<int> v) {
  if (cnt == k) {
    w.push_back(v);
    return;
  }
  for (int i = int(1); i < int(min(n + 1, k - cnt + 1)); i++) {
    vector<int> q = v;
    q.push_back(i);
    f(i, cnt + i, q);
  }
}
int main() {
  int n;
  cin >> n;
  k = n;
  for (int i = int(1); i < int(n + 1); i++) {
    f(i, i, {i});
  }
  vector<string> ans;
  for (int i = 0; i < int(w.size()); i++) {
    string s = "";
    for (int j = 0; j < int(w[i].size()); j++) {
      for (int l = 0; l < int(w[i][j]); l++) {
        s += 'a' + j;
      }
    }
    ans.push_back(s);
  }
  sort((ans).begin(), (ans).end());
  for (int i = 0; i < int(ans.size()); i++) {
    cout << ans[i] << endl;
  }
}
