#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<string> ans[n];
  for (int i = 0; i < (int)n; i++) {
    if (i == 0) {
      string s = "a";
      ans[i].push_back(s);
    } else {
      for (auto s : ans[i - 1]) {
        int k = s[s.length() - 1] - 'a';
        for (int j = 0; j < (int)k + 2; j++) {
          char c = 'a' + j;
          string t = s + c;
          ans[i].push_back(t);
        }
      }
    }
  }
  for (auto s : ans[n - 1]) cout << s << endl;
  return 0;
}
