#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool ch(string st) {
  int mi = -1;
  for (int i = 0; i < st.size(); i++) {
    int x = st[i] - 'a';
    if (x > mi + 1) {
      return 0;
    }
    mi = max(x, mi);
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  vector<pair<string, int>> sp;
  sp.push_back(make_pair("a", 0));
  for (int i = 2; i <= n; i++) {
    vector<pair<string, int>> sx;
    for (int j = (int)sp.size() - 1; j >= 0; j--) {
      for (int x = 0; x <= sp[j].second + 1; x++) {
        string s = sp[j].first;
        s.push_back('a' + x);
        sx.push_back(make_pair(s, max(sp[j].second, x)));
      }
    }
    sp = sx;
  }
  for (int i = 0; i < sp.size(); i++) {
    if (sp[i].first.size() == n) {
      cout << sp[i].first << "\n";
    }
  }
}
