#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
T gcd(T a, T b) {
  return ((b == 0) ? a : gcd(b, a % b));
}
bool good(string a, string b) {
  for (int i = 0; i < (int)(a.size()); i++)
    for (int j = 0; j < (int)(a.size()); j++)
      if (i != j) {
        if (!((a[i] == a[j] && b[i] == b[j]) || (a[i] != a[j] && b[i] != b[j])))
          return 0;
      }
  return 1;
}
set<string> ans;
int n;
void solve(string cur, int nm, int lst, int cnt) {
  if (cnt > 1) {
    ans.insert(cur);
  }
  if (cnt >= n) return;
  char c = 'a' + nm;
  for (int k = (int)(lst); k < (int)(n); k++) {
    string cr = cur;
    for (int l = (int)(lst); l < (int)(k + 1); l++) cr[l] = c;
    solve(cr, nm + 1, k + 1, cnt + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  string in = "";
  for (int i = 0; i < (int)(n); i++) in += 'a';
  ans.insert(in);
  for (int i = (int)(1); i < (int)(n); i++) {
    solve(in, 1, i, 1);
  }
  string ns = "";
  for (int i = 0; i < (int)(n); i++) {
    if (i % 2)
      ns += 'b';
    else
      ns += 'a';
  }
  ans.insert(ns);
  for (string x : ans) cout << x << endl;
  return 0;
}
