#include <bits/stdc++.h>
using namespace std;
const int N = 12;
int32_t main() {
  int n;
  cin >> n;
  vector<vector<int>> dp[N] = {};
  dp[1] = {{1}};
  for (int i = 2; i < n + 2; i++) {
    int sum = 0;
    for (int j = 1; j <= i; j++) {
      for (int k = 0; k < dp[i - j].size(); k++) {
        vector<int> v = dp[i - j][k];
        v.push_back(0);
        sort(v.begin(), v.end());
        for (int l = 0; l < v.size(); l++) {
          vector<int> vec = v;
          vec[l] += j;
          while (vec[vec.size() - 1] == 0) vec.pop_back();
          reverse(vec.begin(), vec.end());
          dp[i].push_back(vec);
        }
      }
    }
  }
  set<string> st;
  for (int i = 0; i < dp[n].size(); i++) {
    string t;
    for (int j = 0; j < dp[n][i].size(); j++) {
      int x = 0;
      for (int k = 0; k < dp[n][i][j]; k++) {
        t += 'a' + j;
        if (k == 0) x++;
      }
    }
    st.insert(t);
  }
  for (auto s : st) {
    cout << s << endl;
  }
}
