#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const long long INF = 1000000000000000000;
vector<string> T;
int N;
void Enu(string t) {
  if (t.size() == N) {
    T.push_back(t);
  } else {
    for (int i = 0; i < 2; i++) {
      string tmp = t;
      char c = (char)('a' + i);
      tmp.push_back(c);
      Enu(tmp);
    }
  }
}
int main() {
  cin >> N;
  string S = "a";
  Enu(S);
  for (int i = 0; i < T.size(); i++) {
    cout << T[i] << endl;
  }
}
