#include <bits/stdc++.h>
using namespace std;
int N;
void solve(string S, char add) {
  S += add;
  if (S.length() == N) {
    cout << S << endl;
  } else {
    for (char i = 'a'; i <= add + 1; i++) {
      solve(S, i);
    }
  }
}
int main() {
  cin >> N;
  solve("", 'a');
  return 0;
}
