#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string t = "abcdefghijklmnopqrstuvwxyz";
  vector<string> s[10];
  s[0] = {"a"};
  for (int i = 0; i < (int)(n - 1); i++) {
    for (auto& c : s[i]) {
      char lastchar = *c.rbegin();
      for (char x = 'a'; x < lastchar + 2; ++x) {
        s[i + 1].push_back(c + x);
      }
    }
  }
  for (auto& c : s[n - 1]) {
    cout << c << endl;
  }
}
