#include <bits/stdc++.h>
using namespace std;
int N;
queue<string> Q;
vector<string> ans;
int main() {
  cin >> N;
  Q.push("a");
  while (Q.size() > 0) {
    string S = Q.front();
    Q.pop();
    if (S.size() == N) {
      ans.push_back(S);
    } else {
      for (int i = 0; i < S.size() + 1; ++i) {
        if (i == 0) {
          Q.push(S + "a");
        }
        if (i == 1) {
          Q.push(S + "b");
        }
        if (i > 1) {
          char memo;
          if (i == 2) memo = 'b';
          if (i == 3) memo = 'c';
          if (i == 4) memo = 'd';
          if (i == 5) memo = 'e';
          if (i == 6) memo = 'f';
          if (i == 7) memo = 'g';
          if (i == 8) memo = 'h';
          bool nnn = false;
          for (auto t : S) {
            if (t == memo) nnn = true;
          }
          if (nnn) {
            string aaa;
            if (memo == 'b') aaa = "c";
            if (memo == 'c') aaa = "d";
            if (memo == 'd') aaa = "e";
            if (memo == 'e') aaa = "f";
            if (memo == 'f') aaa = "g";
            if (memo == 'g') aaa = "h";
            if (memo == 'h') aaa = "i";
            Q.push(S + aaa);
          }
        }
      }
    }
  }
  sort(ans.begin(), ans.end());
  for (auto s : ans) {
    cout << s << endl;
  }
  return 0;
}
