#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
vector<vector<int>> a(0);
void dfs(int n, vector<int> b) {
  if (b.size() == 0) {
    a.push_back(vector<int>(1, n));
    for (int i = 1; n - i >= 1; i++) {
      dfs(n - i, vector<int>(1, i));
    }
    return;
  }
  for (int i = 1; i <= b.back(); i++) {
    if (n - i < 0) continue;
    vector<int> c = b;
    c.push_back(i);
    if (n - i == 0) a.push_back(c);
    if (n - i > 0) dfs(n - i, c);
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> b(0);
  dfs(n, b);
  set<string> ans;
  for (vector<int> c : a) {
    vector<int> tmp(0);
    for (int i = 0; i < (c.size()); ++i)
      for (int j = 0; j < (c[i]); ++j) tmp.push_back(i);
    do {
      char ch = 'a' - 1;
      map<int, char> mp;
      string str = "";
      for (int i = 0; i < (tmp.size()); ++i) {
        if (mp.count(tmp[i]) == 0) {
          ch += 1;
          str += ch;
          mp[tmp[i]] = ch;
        } else {
          str += mp[tmp[i]];
        }
      }
      ans.insert(str);
    } while (next_permutation(tmp.begin(), tmp.end()));
  }
  for (auto x : ans) {
    cout << x << endl;
  }
}
