#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long oo = 1e9 + 10;
const int Max = 1e6 + 10;
const double eps = 1e-18;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
void bt(vector<string> &res, int n, int ca, string &ans, int st) {
  if (ca == 0) {
    res.push_back(ans);
    return;
  }
  for (int i = st; i < n; i++) {
    ans[i] = 'a';
    bt(res, n, ca - 1, ans, i + 1);
    ans[i] = 'b';
  }
}
void solve() {
  int n;
  cin >> n;
  vector<string> res;
  for (int i = 1; i <= n; i++) {
    string ans(n, 'b');
    bt(res, n, i, ans, 0);
  }
  for (int i = 0; i < (int)(res.size()); i++) {
    if (res[i][0] == 'a') cout << res[i] << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  solve();
  return 0;
}
