#include <bits/stdc++.h>
using namespace std;
vector<string> v;
string a = "a", b = "b";
void genr(int n, int i, string &s) {
  if (i == n) {
    v.push_back(s);
    return;
  }
  if (i == 0) {
    s = s + a;
    genr(n, i + 1, s);
  } else {
    string x = s;
    s = s + a;
    x = x + b;
    genr(n, i + 1, s);
    genr(n, i + 1, x);
  }
}
int main() {
  int n;
  cin >> n;
  string s = "";
  genr(n, 0, s);
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
  return 0;
}
