#include <bits/stdc++.h>
using namespace std;
void fun(string s, int k, int n) {
  if (k == n) {
    cout << s << endl;
  } else {
    for (int i = 0; i <= s[(int)s.size() - 1] - 'a' + 1; ++i) {
      string temp = s + (char)('a' + i);
      fun(temp, k + 1, n);
    }
  }
  return;
}
int main() {
  int n;
  cin >> n;
  string s = "a";
  fun(s, 1, n);
  return 0;
}
