#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
void createString(int pos, int num, string s) {
  if (pos == n) {
    cout << s << endl;
  } else {
    for (int i = num; i < n and i <= num + 1; i++) {
      char t = i + 'a';
      string next = s + t;
      createString(pos + 1, i, next);
    }
  }
}
int main(void) {
  cin >> n;
  int cnt = n;
  createString(1, 0, "a");
}
