#include <bits/stdc++.h>
std::vector<std::string> vecArray[12][12];
std::vector<std::string> ansVec;
char alphabets[] = {'0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
int main(int argc, char *argv[]) {
  int n;
  std::cin >> n;
  vecArray[1][1].push_back("a");
  for (int i = 1; i < n; i++) {
    for (int j = 1; j <= i; j++) {
      for (std::string item : vecArray[i][j]) {
        if (i == n - 1) {
          ansVec.push_back(item + alphabets[j + 1]);
        } else {
          vecArray[i + 1][j + 1].push_back(item + alphabets[j + 1]);
        }
        for (int k = 1; k <= j; k++) {
          if (i == n - 1) {
            ansVec.push_back(item + alphabets[k]);
          } else {
            vecArray[i + 1][j].push_back(item + alphabets[k]);
          }
        }
      }
    }
  }
  std::sort(ansVec.begin(), ansVec.end());
  for (std::string s : ansVec) {
    std::cout << s << std::endl;
  }
  return 0;
}
