#include <bits/stdc++.h>
using namespace std;
vector<string> s;
int max_n;
void dfs(int n, string t) {
  char tmp;
  for (int i = 0; i < (max_n - n) + 1; i++) {
    tmp = 97 + i;
    string p = t + tmp;
    int k = n - 1;
    if (!k) s.push_back(p);
    if (k > 0) dfs(k, p);
  }
}
int main() {
  cin >> max_n;
  string t = "";
  dfs(max_n, t);
  for (int i = 0; i < s.size(); i++) cout << s.at(i) << endl;
  return 0;
}
