#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> all(26);
  for (int i = 0; i < (int)(n - 1); i++) all[i] = 'a' + i;
  vector<string> ans;
  vector<string> n_ans;
  int ct = 1;
  ans.push_back("a");
  while (ct < n) {
    for (int i = 0; i < (int)(ans.size()); i++) {
      string uni = ans[i];
      unique(uni.begin(), uni.end());
      int uni_size = uni.length();
      for (int j = 0; j < (int)(uni_size + 1); j++) {
        n_ans.push_back(ans[i] + all[j]);
      }
    }
    ans = n_ans;
    ct++;
  }
  sort(n_ans.begin(), n_ans.end());
  for (int i = 0; i < (int)(n_ans.size()); i++) cout << n_ans[i] << endl;
}
