#include <bits/stdc++.h>
using namespace std;
int main() {
  long long nn;
  cin >> nn;
  set<string> ans;
  queue<string> qq;
  qq.push("a");
  while (!qq.empty()) {
    string tmp = qq.front();
    qq.pop();
    if (tmp.length() == nn) {
      ans.insert(tmp);
      continue;
    }
    for (char cc = 'a'; cc <= tmp[tmp.length() - 1] + 1; cc++) {
      qq.push(tmp + cc);
    }
  }
  for (set<string>::iterator ite = ans.begin(); ite != ans.end(); ite++) {
    cout << *ite << endl;
  }
  return 0;
}
