#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> A;
  for (int i = 0; i < (1 << N); i++) {
    string S;
    for (int j = 0; j < N; j++) {
      if (i & (1 << j))
        S.push_back('b');
      else
        S.push_back('a');
    }
    A.push_back(S);
  }
  sort(A.begin(), A.end());
  cout << A.at(0) << endl;
  for (int i = 1; i < A.size(); i++) {
    if (A.at(i).at(0) == 'a') {
      bool check = true;
      for (int j = 0; j < A.at(i).size(); j++) {
        for (int k = 0; k < A.at(i).size(); k++) {
          if (j == k) continue;
          if (A.at(i).at(j) != A.at(i).at(k) &&
              A.at(i - 1).at(j) == A.at(i - 1).at(k))
            check = false;
          else if (A.at(i).at(j) == A.at(i).at(k) &&
                   A.at(i - 1).at(j) != A.at(i - 1).at(k))
            check = false;
        }
      }
      if (!check) cout << A.at(i) << endl;
    }
  }
}
