#include <bits/stdc++.h>
using namespace std;
struct Data {
  string str;
  int num;
  Data() {}
  Data(string _str, int _num) : str(_str), num(_num) {}
};
int main() {
  int n;
  cin >> n;
  vector<vector<Data>> v(n, vector<Data>());
  v[0].emplace_back(Data(string{'a'}, 1));
  for (int len = 0; len < n - 1; len++) {
    for (Data parent : v[len]) {
      for (int i = 0; i <= parent.num; i++) {
        Data tmp = parent;
        char c = 'a' + i;
        tmp.str.push_back(c);
        tmp.num = i + 1;
        v[len + 1].emplace_back(tmp);
      }
    }
  }
  for (Data x : v[n - 1]) {
    cout << x.str << endl;
  }
  return 0;
}
