#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s(pow(2, n), "a");
  for (int bit = 0; bit < (1 << n - 1); ++bit) {
    char now = 'a';
    for (int i = n - 2; i >= 0; i--) {
      if (bit & (1 << i)) {
        if (now == 'a')
          now = 'b';
        else
          now = 'a';
      }
      s.at(bit).push_back(now);
    }
  }
  for (int bit = 0; bit < (1 << n - 1); ++bit) {
    char now = 'a';
    for (int i = n - 2; i >= 0; i--) {
      if (bit & (1 << i)) {
        now++;
      }
      s.at(bit + pow(2, n - 1)).push_back(now);
    }
  }
  sort(s.begin(), s.end());
  string tmp = s.at(0);
  for (int bit = 1; bit < (1 << n); ++bit) {
    if (tmp != s.at(bit)) cout << s.at(bit) << endl;
    tmp = s.at(bit);
  }
}
