#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const int MOD = 1000000007;
const int N = 300555;
const int M = 1155;
void solve() {
  int n;
  cin >> n;
  string s[20];
  int x = (1 << (n - 1));
  for (int mask = 0; mask < x; mask++) {
    s[mask] += 'a';
    for (int j = 0; j < n - 1; j++) {
      if (mask & (1 << j))
        s[mask] += 'b';
      else
        s[mask] += 'a';
    }
  }
  sort(s, s + x);
  for (int i = 0; i < x; i++) {
    cout << s[i] << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
