#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll, ll>;
int main() {
  ll N;
  cin >> N;
  queue<string> Q;
  Q.push("a");
  for (ll(i) = (1), (i_len) = (N); (i) < (i_len); ++(i)) {
    queue<string> R = Q;
    while (!Q.empty()) Q.pop();
    while (!R.empty()) {
      string S = R.front();
      R.pop();
      for (ll(i) = ('a'), (i_len) = (S.back() + 2); (i) < (i_len); ++(i))
        Q.push(S + (char)i);
    }
  }
  while (!Q.empty()) {
    cout << (Q.front()) << endl;
    Q.pop();
  }
  return 0;
}
