#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<string> > s(10, vector<string>());
  vector<int> num(10, 0);
  char a[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
  if (n == 1) {
    cout << 'a' << endl;
  } else if (n == 2) {
    cout << "aa" << endl << "ab" << endl;
  } else {
    num.at(0) = 1;
    s.at(0).push_back("a");
    for (size_t i = 0; i < n - 1; i++) {
      int ii = s.at(i).size();
      for (size_t j = 0; j < ii; j++) {
        char jj = s.at(i).at(j).at(s.at(i).at(j).size() - 1);
        for (size_t k = 0; k < jj - 'a' + 2; k++) {
          s.at(i + 1).push_back(s.at(i).at(j) + a[k]);
        }
      }
    }
  }
  for (size_t i = 0; i < s.at(n - 1).size(); i++) {
    cout << s.at(n - 1).at(i) << endl;
  }
}
