#include <bits/stdc++.h>
using namespace std;
void normal(int len, char ch = 'a', int index = 0, string str = "") {
  if (index == len) {
    cout << str << endl;
    return;
  }
  for (int i = 0; i <= ch - 'a'; ++i) {
    normal(len, 'a' + i + 1, index + 1, str + char('a' + i));
  }
}
int main() {
  int n;
  cin >> n;
  if (n >= 0) normal(n);
  return 0;
}
