#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<string>> ans(10, vector<string>(0));
  vector<string> chars = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  ans.at(0).push_back(chars.at(0));
  for (int i = 1; i < 10; i++) {
    for (int j = 0; j < chars.at(i - 1).size(); j++) {
      for (int k = 0; k <= i; k++) {
        string tmp;
        tmp = ans.at(i - 1).at(j) + chars.at(k);
        ans.at(i).push_back(tmp);
      }
    }
  }
  int N;
  cin >> N;
  for (int i = 0; i < ans.at(N - 1).size(); i++)
    cout << ans.at(N - 1).at(i) << endl;
}
