#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
signed main() {
  long long n;
  cin >> n;
  queue<string> que;
  que.push("");
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < pow(2, i - 1); j++) {
      string key = que.front();
      que.pop();
      string new1 = key + 'a';
      string new2 = key + 'b';
      que.push(new1);
      if (i != 0) que.push(new2);
    }
  }
  vector<string> A;
  while (que.size() > 0) {
    A.push_back(que.front());
    que.pop();
  }
  sort(A.begin(), A.end());
  for (long long i = 0; i < A.size(); i++) cout << A[i] << endl;
}
