#include <bits/stdc++.h>
using namespace std;
vector<string> mv;
int n;
string ret;
void dfs(int p) {
  if (p == n) {
    mv.push_back(ret);
    return;
  }
  for (int i = 0; i < 2; i++) {
    ret.push_back('a' + i);
    dfs(p + 1);
    ret.pop_back();
  }
}
int main() {
  cin >> n;
  ret.push_back('a');
  dfs(1);
  for (auto it : mv) cout << it << endl;
  return 0;
}
