#include <bits/stdc++.h>
using namespace std;
int bitcount(int n) {
  int res = 0;
  while (n) {
    if (n % 2) res++;
    n /= 2;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a\n";
    return 0;
  }
  vector<string> sts;
  for (int i = 0; i < (1 << n); i++) {
    string str(n, 'A');
    char tmp = 'a';
    char sme = 'A';
    if (bitcount(i) == 1 || bitcount(i) == 0) continue;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        if (sme == 'A')
          sme = tmp, str[j] = tmp, tmp++;
        else
          str[j] = sme;
      } else
        str[j] = tmp, tmp++;
    }
    sts.push_back(str);
  }
  string str;
  char tmp = 'a';
  for (int i = 0; i < n; i++) str.push_back(tmp), tmp++;
  sts.push_back(str);
  sort(sts.begin(), sts.end());
  for (int i = 0; i < sts.size(); i++) cout << sts[i] << "\n";
}
