#include <bits/stdc++.h>
using namespace std;
const int INF = 1145141919, MOD = 1e9 + 7;
const int64_t LINF = 8931145141919364364, LMOD = 998244353;
int main() {
  int n;
  cin >> n;
  vector<string> ans;
  ans.emplace_back("a");
  for (int i = 1; i < n; ++i) {
    vector<string> nxt;
    for (string& s : ans) {
      char c = s.back();
      for (char cc = 'a'; cc <= (char)(c + i); ++cc) {
        nxt.emplace_back(s + cc);
      }
    }
    ans = nxt;
  }
  sort(ans.begin(), ans.end());
  for (string& s : ans) {
    cout << s << '\n';
  }
  return 0;
}
