#include <bits/stdc++.h>
using namespace std;
vector<string> v;
void gen(int n) {
  queue<string> q;
  q.push("a");
  while (true) {
    string s1 = q.front();
    if (s1.length() > n) break;
    q.pop();
    v.push_back(s1);
    string s2 = s1;
    q.push(s1.append("a"));
    q.push(s2.append("b"));
  }
}
int main() {
  int n;
  cin >> n;
  gen(n);
  int p = 0;
  for (int i = 0; i < n - 1; i++) {
    p += (int)pow(2, i);
  }
  for (int i = p; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
