#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
constexpr ll INF = 1ll << 60;
int main(int argc, char **argv) {
  ll N;
  cin >> N;
  vector<string> res;
  string a(N, 'a');
  for (ll bits = 0; bits < (1 << (N - 1)); ++bits) {
    ll c{0};
    string tmp = a;
    for (ll i = 0; i < N - 1; ++i) {
      if (bits & (1 << i)) {
        tmp[i + 1] = ('b' + c);
        ++c;
      }
    }
    res.push_back(tmp);
  }
  sort(res.begin(), res.end());
  for (auto &e : res) {
    std::cout << e << std::endl;
  }
}
