#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<string, int>> strset, preset;
  vector<string> al = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  strset.push_back(make_pair(al[0], 1));
  for (int i = 0; i < (n); i++) {
    preset = strset;
    strset.clear();
    for (auto it = preset.begin(); !(it == preset.end()); it++) {
      cerr << (*it).first << "\n";
      for (int i = 0; i < ((*it).second); i++) {
        strset.push_back(make_pair((*it).first + al[i], (*it).second));
      }
      strset.push_back(
          make_pair((*it).first + al[(*it).second], (*it).second + 1));
    }
  }
  return 0;
}
