#include <bits/stdc++.h>
using namespace std;
vector<string> build(int n) {
  if (n == 1) return {"a"};
  auto pre = build(n - 1);
  vector<string> res;
  for (string s : pre) {
    for (char c = 'a'; c <= s.back() + 1; c++) {
      string tmp = s;
      tmp.push_back(c);
      res.push_back(tmp);
    }
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  auto res = build(n);
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << endl;
  }
}
