#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(cin.tie(NULL));
  cout.tie(NULL);
  long long int tc = 1;
  while (tc--) {
    vector<string> v;
    string p = "a";
    v.push_back(p);
    long long int n;
    cin >> n;
    long long int curr = 'a';
    vector<char> pos;
    pos.push_back(curr);
    vector<string> final;
    for (long long int i = 1; i < n; i++) {
      long long int sz = v.size();
      curr++;
      pos.push_back(curr);
      for (long long int j = 0; j < sz; j++) {
        for (long long int k = 0; k < pos.size(); k++) {
          string res = v[j] + pos[k];
          v.push_back(res);
        }
      }
    }
    for (long long int i = 0; i < v.size(); i++) {
      if (v[i].size() == n) final.push_back(v[i]);
    }
    sort(final.begin(), final.end());
    for (long long int i = 0; i < final.size(); i++) {
      cout << final[i] << endl;
    }
  }
}
