#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const int INF = 1 << 30;
const ll INFll = 1ll << 62;
const ld EPS = 1e-10;
const int MOD = int(1e9) + 7;
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<string> a;
  a.push_back("a");
  auto f = [](vector<string> v) {
    vector<string> res;
    for (auto e : v) {
      int x = e[e.size() - 1] - 'a';
      for (int i = int(0); i < int(x + 2); i++) {
        res.push_back(e + char('a' + i));
      }
    }
    return res;
  };
  for (int i = int(0); i < int(n - 1); i++) a = f(a);
  for (auto e : a) {
    cout << e << endl;
  }
  return 0;
}
