#include <bits/stdc++.h>
using namespace std;
vector<string> v;
void printAllKLengthRec(char set[], string prefix, int n, int k) {
  if (k == 0) {
    if (prefix[0] != 'b') v.push_back(prefix);
    return;
  }
  for (int i = 0; i < n; i++) {
    string newPrefix;
    newPrefix = prefix + set[i];
    printAllKLengthRec(set, newPrefix, n, k - 1);
  }
}
void printAllKLength(char set[], int k, int n) {
  printAllKLengthRec(set, "", n, k);
}
int main() {
  int n;
  cin >> n;
  char set1[] = {'a', 'b'};
  printAllKLength(set1, n, 2);
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i] << '\n';
}
