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