#include <bits/stdc++.h>
using namespace std;
static const long long MAX = 1000000;
static const long long INFTY = 1e12;
struct edge {
  long long to, cost;
};
using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;
int H, W;
vector<vector<char>> field;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
vector<bool> seen;
vector<int> colors;
int main() {
  int N;
  cin >> N;
  string ans = "";
  vector<string> _ans;
  vector<int> tmp(N - 1, 0);
  for (int bit = 0; bit < (1 << N - 1); ++bit) {
    fill(tmp.begin(), tmp.end(), 0);
    vector<int> S;
    for (int i = 0; i < N - 1; ++i) {
      if (bit & (1 << i)) {
        tmp[i] = 1;
        S.push_back(i);
      }
    }
    ans = "a";
    for (int i = 0, i_len = (N - 1); i < i_len; ++i) {
      if (tmp[i] == 0) {
        ans += "a";
      } else {
        ans += "b";
      }
    }
    _ans.push_back(ans);
  }
  sort(_ans.begin(), _ans.end());
  for (int i = 0, i_len = (_ans.size()); i < i_len; ++i) {
    cout << _ans[i] << endl;
  }
}
