#include <bits/stdc++.h>
using namespace std;
void solv(int pos, int curr, string s, int N) {
  if (pos == N - 1) {
    s += ('a' + curr);
    cout << s << "\n";
    return;
  }
  for (int i = 0; i <= curr + 1; i++)
    solv(pos + 1, i, s + (char)('a' + curr), N);
}
int main(void) {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int N;
  cin >> N;
  solv(0, 0, "", N);
  return 0;
}
