#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class Iit>
void vout(const Iit &begin, const Iit &end, ostream &out) {
  for (auto it = begin; it != end; it++) {
    auto tmp = it;
    if (++tmp == end)
      out << *it << '\n';
    else
      out << *it << " ";
  }
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> ans;
  vector<int> v(n);
  while (v[n - 1] == 0) {
    string s;
    for (int i = 0; i < (n); i++) s.push_back('a' + v[i]);
    reverse((s).begin(), (s).end());
    ans.push_back(s);
    v[0]++;
    for (int i = 0; i < (n - 1); i++) {
      if (v[i] == v[i + 1] + 2) {
        v[i + 1]++;
        v[i] = 0;
      }
    }
  }
  for (int i = 0; i < (ans.size()); i++) cout << ans[i] << '\n';
  return 0;
}
