#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const long long MOD = 1000000007;
const int MAX = 510000;
int main() {
  int N;
  cin >> N;
  set<string> w;
  w.insert("a");
  for (int i = 1; i < N; i++) {
    set<string> tmp;
    for (auto value : w) {
      tmp.insert(value + "a");
      tmp.insert(value + "b");
    }
    w = tmp;
  }
  for (auto value : w) cout << value << endl;
  return 0;
}
