#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-Ofast")
using namespace std;
const long long MAX = 2e5 + 5;
const long long MAX2 = 2e5 + 4;
const long long MAAX = 2e18;
const long long MOD = 1e9 + 7;
long long n;
set<string> st;
void fun(long long idx, string cur) {
  if (idx == n) {
    if (cur[0] == 'a') st.insert(cur);
    return;
  }
  fun(idx + 1, cur + 'a');
  fun(idx + 1, cur + 'b');
  return;
}
long long main() {
  cin >> n;
  fun(0, "");
  vector<string> v(st.begin(), st.end());
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  return 0;
}
