#include <bits/stdc++.h>
using namespace std;
int n;
const string alpha = "abcdefghijkl";
void normal(int q, string x) {
  if (q >= n)
    cout << x << endl;
  else {
    for (int i = 0; i <= q; i++) normal(q + 1, x + alpha[i]);
  }
}
int main(int argc, char const *argv[]) {
  cin >> n;
  string x = "";
  normal(0, x);
  return 0;
}
