#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool a[n];
  string s = "";
  set<string> ss;
  for (int i = 0; i < (1 << n); i++) {
    s = "";
    int tmp = 0;
    for (int j = 0; j < n; j++) s += "a";
    for (int j = 0; j < n - 1; j++) {
      if (i & (1 << j)) tmp++;
      s[j + 1] = (char)(s[j + 1] + tmp);
    }
    ss.insert(s);
  }
  for (string sss : ss) {
    cout << sss << endl;
  }
}
