#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> v;
  v.push_back("a");
  for (int i = 1; i < n; i++) {
    vector<string> new_v;
    for (auto& s : v) {
      char c = s[(int)s.size() - 1];
      int k = c - 'a';
      for (int j = k; j <= min(25, k + 1); j++) {
        string t = s + (char)(j + 'a');
        new_v.push_back(t);
      }
    }
    swap(v, new_v);
  }
  for (auto& s : v) {
    cout << s << '\n';
  }
  return 0;
}
