#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main() {
  int N;
  cin >> N;
  vector<string> pre;
  vector<string> PRE;
  for (int i = 0; i < N; ++i) {
    vector<string> ans;
    vector<string> ANS;
    if (i == 0) {
      ans.push_back("0");
      ANS.push_back("a");
    } else {
      int ma = 0;
      for (int j = 0; j < pre.size(); ++j) {
        int hoge = stoi(pre.at(j));
        ma = max(ma, hoge);
        for (int k = 0; k <= ma + 1; ++k) {
          ans.push_back(to_string(k));
        }
      }
      string tmp;
      int zero = -1;
      for (int j = 0; j < ans.size(); ++j) {
        int s = stoi(ans.at(j));
        if (s == 0) {
          ++zero;
          tmp = PRE.at(zero);
          ANS.push_back(tmp + "a");
        } else if (s == 1)
          ANS.push_back(tmp + "b");
        else if (s == 2)
          ANS.push_back(tmp + "c");
        else if (s == 3)
          ANS.push_back(tmp + "d");
        else if (s == 4)
          ANS.push_back(tmp + "e");
        else if (s == 5)
          ANS.push_back(tmp + "f");
        else if (s == 6)
          ANS.push_back(tmp + "g");
        else if (s == 7)
          ANS.push_back(tmp + "h");
        else if (s == 8)
          ANS.push_back(tmp + "i");
        else if (s == 9)
          ANS.push_back(tmp + "j");
      }
    }
    pre = ans;
    PRE = ANS;
  }
  for (int i = 0; i < PRE.size(); ++i) cout << PRE.at(i) << endl;
}
