#include <bits/stdc++.h>
using namespace std;
long long int n;
vector<string> null;
vector<string> solve(int ch, int k) {
  if (k == 0) return null;
  vector<string> v;
  for (int i = 1; i <= k; i++) {
    vector<string> temp = solve(ch + 1, k - i);
    long long int val = i;
    string fck;
    while (val--) fck.push_back(char(ch + 'a'));
    for (int j = 0; j < temp.size(); j++) {
      string xx = fck + temp[j];
      v.push_back(xx);
    }
  }
  return v;
}
int main() {
  cin >> n;
  null.push_back(" ");
  vector<string> ans = solve(0, n);
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << '\n';
}
