#include <bits/stdc++.h>
int main() {
  long N;
  std::cin >> N;
  std::vector<std::vector<std::string> > A;
  std::vector<std::string> temp;
  temp.push_back("a");
  A.push_back(temp);
  long num = 1;
  for (long i = 1; i < N; i++) {
    std::vector<std::string> temp4;
    temp4.clear();
    std::vector<std::string> temp2 = A[i - 1];
    for (long j = 0; j < temp2.size(); j++) {
      std::string temp3 = temp2[j];
      int len = temp3.length();
      for (long k = 97; k <= (int)temp3[len - 1] + 1; k++) {
        std::string empty = "";
        char onechara = k;
        empty += onechara;
        std::string temp6 = temp3;
        std::string temp5 = temp6 += empty;
        empty.clear();
        temp4.push_back(temp5);
      }
    }
    A.push_back(temp4);
  }
  std::vector<std::string> result = A[N - 1];
  std::sort(result.begin(), result.end());
  for (long j = 0; j < result.size(); j++) {
    std::cout << result[j] << std::endl;
  }
  return 0;
}
