#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  queue<string> que;
  string s = "a";
  que.push(s);
  while (1) {
    string t = que.front();
    int sz = t.size();
    if (sz == n) break;
    que.pop();
    for (int i = 0; i < t[sz - 1] - 'a' + 2; i++) {
      char c = 'a' + i;
      string ad = t + c;
      que.push(ad);
    }
  }
  while (!que.empty()) {
    string t = que.front();
    que.pop();
    cout << t << endl;
  }
  return 0;
}
