#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  set<string> ans;
  ans.insert("a");
  for (int i = (int)(1); i < (int)(n); i++) {
    set<string> ad_st;
    for (string t : ans) {
      int sz = t.size();
      for (int j = 0; j < (int)(t[sz - 1] - 'a' + 2); j++) {
        string add = t;
        char bc = 'a' + j;
        add.push_back(bc);
        ad_st.insert(add);
      }
    }
    ans = ad_st;
  }
  for (auto ss : ans) {
    cout << ss << endl;
  }
  return 0;
}
