#include <bits/stdc++.h>
using namespace std;
vector<string> outputSubstring(vector<string> protos, int k);
int main() {
  int n;
  cin >> n;
  vector<string> result = {"a"};
  for (int i = 1; i < n; i++) {
    result = outputSubstring(result, i);
    sort(result.begin(), result.end());
  }
  int k = result.size();
  for (int i = 0; i < k; i++) cout << result.at(i) << endl;
  return 0;
}
vector<string> outputSubstring(vector<string> protos, int k) {
  int n;
  n = protos.size();
  vector<string> result = {};
  for (int i = 0; i <= k; i++) {
    for (int j = 0; j < n; j++) {
      result.push_back(protos.at(j) + (char)(i + 97));
    }
  }
  return result;
}
