#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s = "aabcdefghijklmnopqrstuvwxyz";
  vector<pair<string, int> > num[11];
  num[1].push_back(make_pair("a", 1));
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < num[i - 1].size(); j++) {
      for (int k = 1; k <= num[i - 1][j].second + 1; k++) {
        num[i].push_back(make_pair(num[i - 1][j].first + s[k], k));
      }
    }
  }
  for (int i = 0; i < num[n].size(); i++) {
    cout << num[n][i].first << endl;
  }
  return 0;
}
