#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <class T>
using V = vector<T>;
using Graph = vector<vector<int>>;
using P = pair<long long, long long>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1e18;
set<string> que;
int n;
void f(string s, int k) {
  if (k == n) {
    que.insert(s);
    return;
  }
  char c, cc;
  c = s[k - 1];
  int z = c - 'a';
  z++;
  c = z + 'a';
  string t = s;
  s += c;
  f(s, k + 1);
  t += cc;
  f(t, k + 1);
}
void solve() {
  for (int i = 0; i < (1 << n); i++) {
    bool ok = 1;
    string t;
    for (int j = 0; j < n; j++) {
      if (j == 0) {
        if (i >> j & 1) {
          ok = 0;
          break;
        }
      }
      if (i >> j & 1) {
        t += 'b';
      } else
        t += 'a';
    }
    if (!ok) continue;
    que.insert(t);
  }
  string s = "a";
  f(s, 1);
}
signed main() {
  cin >> n;
  solve();
  while (!que.empty()) {
    string t = *begin(que);
    cout << t << endl;
    que.erase(t);
  }
}
