#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using pll = pair<ll, ll>;
const ll mod = static_cast<ll>(1e9) + 7;
ll N;
const ll MAXN = 10;
vector<string> S[MAXN];
int main() {
  cin >> N;
  S[0].push_back("a");
  for (ll i = 0; i < ll(N); ++i) {
    for (const auto& s : S[i]) {
      const ll jn = (s[i] - 'a') + 2;
      for (ll j = 0; j < ll(jn); ++j) {
        string ss = s;
        ss += ('a' + j);
        S[i + 1].emplace_back(ss);
      }
    }
  }
  for (const auto& s : S[N - 1]) {
    cout << s << endl;
  }
  return 0;
}
