#include <bits/stdc++.h>
using namespace std;
void makeStr(string str, int current, int charIndex, int maxNum) {
  if (current > maxNum) {
    cout << str << endl;
    return;
  }
  for (int i = 0; i <= charIndex; i++) {
    string next = {(char)('a' + i)};
    makeStr(str + next, current + 1, i + 1, maxNum);
  }
  return;
}
int main() {
  int N;
  cin >> N;
  makeStr("", 1, 0, N);
  return 0;
}
