#include <bits/stdc++.h>
using namespace std;
vector<string> normal(int i) {
  vector<string> ans, tmp;
  if (i == 1) {
    ans.push_back("a");
    return ans;
  }
  tmp = normal(i - 1);
  for (const string& str : tmp) {
    char last = str[str.length() - 1];
    for (char c = 'a'; c <= last + 1; c++) {
      ans.push_back(str + c);
    }
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<string> v;
  v = normal(n);
  for (string str : v) {
    cout << str << endl;
  }
}
