#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int K = 1;
  for (int i = 1; i <= N; i++) K = K * i;
  unordered_map<int, string> idStrMap;
  idStrMap.emplace(1, "a");
  idStrMap.emplace(2, "b");
  idStrMap.emplace(3, "c");
  idStrMap.emplace(4, "d");
  idStrMap.emplace(5, "e");
  idStrMap.emplace(6, "f");
  idStrMap.emplace(7, "g");
  idStrMap.emplace(8, "h");
  idStrMap.emplace(9, "i");
  idStrMap.emplace(10, "j");
  vector<string> patterns(K);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < K; j++) {
      if (i == 0)
        patterns[j] = "a";
      else
        patterns[j] = patterns[j] + idStrMap[j % (i + 1) + 1];
    }
  }
  sort(patterns.begin(), patterns.end());
  for (auto &elem : patterns) {
    cout << elem << endl;
  }
  return 0;
}
