#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  queue<string> ans;
  ans.push("a");
  for (int i = 0; i < (int)(N - 1); i++) {
    queue<string> temp;
    while (ans.size()) {
      string preAns = ans.front();
      ans.pop();
      for (int j = 0; j < (int)(preAns.back() - 'a' + 2); j++) {
        char moji = j + 'a';
        string s = preAns + moji;
        temp.push(s);
      }
    }
    ans = temp;
  }
  while (ans.size()) {
    cout << ans.front() << endl;
    ans.pop();
  }
  return 0;
}
