#include <bits/stdc++.h>
using namespace std;
void isomorphic(char *a, int i, char c, int t) {
  if (i == t) {
    a[i] = '\0';
    cout << a << " ";
    return;
  }
  for (char ch = 'a'; ch <= 'c'; ch++) {
    a[i] = ch;
    if (ch == c)
      isomorphic(a, i + 1, c + 1, t);
    else
      isomorphic(a, i + 1, c, t);
  }
}
int main() {
  int t;
  cin >> t;
  char a[100];
  char c;
  c = 'a';
  isomorphic(a, 0, c, t);
}
