#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> sol, tmp;
int main() {
  cin >> n;
  sol.push_back("a");
  for (int i = 2; i <= n; i++) {
    vector<string> tmp;
    for (int j = 0; j < sol.size(); j++) {
      for (char x = 'a'; x < 'a' + i; x++) {
        tmp.push_back(sol[j] + x);
      }
    }
    sol = tmp;
  }
  for (int i = 0; i < sol.size(); i++) {
    cout << sol[i] << endl;
  }
  return 0;
}
