#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  stack<string> res;
  res.push("a");
  for (int i = 1; i < n; i++) {
    vector<string> temp;
    while (!res.empty()) {
      string curr = res.top();
      temp.push_back(curr + "a");
      temp.push_back(curr + "b");
      res.pop();
    }
    for (int j = 0; j < temp.size(); j++) {
      res.push(temp[j]);
    }
  }
  while (!res.empty()) {
    cout << res.top() << endl;
    res.pop();
  }
  return 0;
}
