#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> result(0);
void func(int ind, string crt_str, int crt_ch) {
  if (ind == n - 1) {
    result.push_back(crt_str + (char)('a' + crt_ch));
  } else {
    string next = crt_str + (char)('a' + crt_ch);
    for (int i = 0; i < ind + 2; i++) {
      func(ind + 1, next, i);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < 1; i++) {
    func(0, "", i);
  }
  for (int i = 0; i < result.size(); i++) {
    cout << result[i] << endl;
  }
  return 0;
}
