#include <bits/stdc++.h>
using namespace std;
void dout() { cerr << endl; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
using long long = long long;
using pii = pair<long long, long long>;
using ld = long double;
using pll = pair<long long, long long>;
void precalc() {}
template <typename T>
void do_uniq(vector<T> vec) {
  sort((vec).begin(), (vec).end());
  vec.resize(unique((vec).begin(), (vec).end()) - vec.begin());
}
const int MAXN = 1e5 + 29;
void solve() {
  int n;
  cin >> n;
  vector<string> answr;
  for (int i = 0; i < (1 << (n - 1)); ++i) {
    string s = "a";
    for (int j = 0; j < n - 1; ++j) {
      if ((i & (1 << j)) == 0) {
        s += 'a';
      } else {
        s += 'b';
      }
    }
    answr.push_back(s);
  }
  sort((answr).begin(), (answr).end());
  for (auto a : answr) cout << a << "\n";
}
void multisolve() {
  int t;
  cin >> t;
  while (t--) solve();
}
void gen() {
  cout << "100000 99999\n";
  for (int i = 0; i < 99999; ++i) {
    cout << 1 << " " << 2 + i << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cout << fixed << setprecision(20);
  precalc();
  solve();
}
