#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
void gen(int left, string s) {
  if (left == 0) {
    cout << s << "\n";
    return;
  }
  int last = s[s.size() - 1] - 'a';
  for (int i = 0; i <= last + 1; i++) {
    char cur = char(i + 'a');
    gen(left - 1, s + cur);
  }
}
int main() {
  int n;
  cin >> n;
  gen(n - 1, "a");
}
