#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
int N;
void make_str(string S) {
  if (S.size() == N) {
    cout << S << endl;
    return;
  }
  char last_alpha = S[S.size() - 1];
  for (int i = 0; i <= last_alpha - 'a' + 1; i++) {
    char new_last_alpha = 'a' + i;
    make_str(S + new_last_alpha);
  }
  return;
}
int main() {
  cin >> N;
  make_str("a");
  return 0;
}
