#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> ans(0);
  ans.push_back("a");
  for (int i = 0; i < (int)(N - 1); i++) {
    vector<string> temp(0);
    for (int k = 0; k < (int)(ans.size()); k++) {
      string preAns = ans[k];
      for (int j = 0; j < (int)(preAns.back() - 'a' + 2); j++) {
        char moji = j + 'a';
        string s = preAns + moji;
        temp.push_back(s);
      }
    }
    ans = temp;
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < (int)(ans.size()); i++) cout << ans[i] << endl;
  ;
  return 0;
}
