#include <bits/stdc++.h>
using namespace std;
string alpha[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
int check(string str) {
  int count = 0;
  while (true) {
    if (str.find(alpha[count])) {
      count++;
    } else {
      return count;
    }
  }
}
int main() {
  int N;
  cin >> N;
  std::vector<string> K_b;
  std::vector<string> K;
  K_b.push_back(alpha[0]);
  for (int i = 1; i < N; i++) {
    K.clear();
    for (int j = 0; j < K_b.size(); j++) {
      int l = check(K_b[j]) + 1;
      int m = (j + 2) >= i + 1 ? i : j + 2;
      if (j == K_b.size() - 1) m = i + 1;
      for (int k = 0; k < m; k++) {
        K.push_back(K_b[j] + alpha[k]);
      }
    }
    K_b = K;
  }
  for (int i = 0; i < K.size(); i++) {
    cout << K[i] << endl;
  }
}
