#include <bits/stdc++.h>
using namespace std;
void hoge2(string a, string b, vector<string> &ret, string str = "",
           int aidx = 0, int bidx = 0) {
  if (aidx == int(a.size()) && bidx == int(b.size())) {
    ret.push_back(str);
    return;
  }
  if (aidx < int(a.size())) {
    string tmp = str + a[aidx];
    hoge2(a, b, ret, tmp, aidx + 1, bidx);
  }
  if (bidx < int(b.size())) {
    string tmp = str + b[bidx];
    hoge2(a, b, ret, tmp, aidx, bidx + 1);
  }
}
vector<string> hoge(int n, char c = 'a') {
  vector<string> ret;
  for (int i = n - 1; 0 <= i; --i) {
    string tmp(i, c);
    vector<string> vec = hoge(n - 1 - i, c + 1);
    for (auto &v : vec) {
      vector<string> vec2;
      hoge2(tmp, v, vec2);
      for (auto &v2 : vec2) ret.push_back(c + v2);
    }
  }
  if (ret.empty()) ret.push_back("");
  return ret;
}
int main() {
  int n;
  cin >> n;
  for (auto &v : hoge(n)) cout << v << endl;
}
