#include <bits/stdc++.h>
using namespace std;
char startChar = 'a';
void recrusive(int& n, int m, int l, string& str) {
  if (m == n) {
    for (int i = 0; i < l; i++) {
      str[m - 1] = startChar + i;
      cout << str << endl;
    }
  } else {
    for (int i = 0; i < l; i++) {
      str[m - 1] = startChar + i;
      recrusive(n, m + 1, i + 2, str);
    }
  }
}
int main() {
  int n;
  cin >> n;
  string str = "";
  for (int i = 0; i < n; i++) {
    str += startChar;
  }
  recrusive(n, 1, 1, str);
  return 0;
}
