#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = 2147483647;
void next_string(int n, int depth, string pre) {
  if (n == depth) {
    cout << pre << endl;
  } else {
    for (int i = 0; i < (depth + 1); i++) {
      int d = depth + 1;
      string now = pre + (char)('a' + i);
      next_string(n, d, now);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string start = "";
  next_string(n, 0, start);
  return 0;
}
