#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string alpha = "abcdefghijklmnopqrstuvwxyz";
  vector<string> Q;
  for (int i = 0; i < (int)pow(2, N); i++) {
    vector<int> bits;
    int j = i;
    int num_1 = 0;
    for (int k = 0; k < N; k++) {
      bits.push_back(j % 2);
      num_1 += j % 2;
      j = j / 2;
    }
    if (num_1 == 1) continue;
    int p = 0;
    string ans = "";
    string fixed = "";
    for (int k = 0; k < bits.size(); k++) {
      if (bits[k] == 1 && fixed != "") {
        ans += fixed;
      } else {
        ans += alpha[p];
        p++;
      }
      if (bits[k] == 1 && fixed == "") {
        fixed = alpha[p - 1];
      }
    }
    Q.emplace_back(ans);
  }
  sort(Q.begin(), Q.end());
  for (auto s : Q) {
    cout << s << endl;
  }
  return 0;
}
