#include <bits/stdc++.h>
using namespace std;
vector<string> get_vector(int k) {
  vector<string> v = {};
  vector<string> tmp = {};
  int aa_count = 0;
  if (k == 1) {
    v.push_back("a");
  } else if (k == 2) {
    v.push_back("aa");
    v.push_back("ab");
  } else {
    aa_count = 0;
    tmp = get_vector(k - 1);
    for (int i = 0; i < tmp.size(); ++i) {
      v.push_back("a" + tmp[i]);
      if (tmp[i].substr(0, 2) == "aa") {
        aa_count++;
      }
    }
    for (int i = aa_count; i < tmp.size(); ++i) {
      for (int j = 0; j < (k - 1); ++j) {
        char ch = 'a' + j;
        string last{ch};
        v.push_back(tmp[i] + last);
      }
    }
    char ch = 'a' + (k - 1);
    string last{ch};
    v.push_back(tmp[tmp.size() - 1] + last);
  }
  return v;
}
int main() {
  int n;
  cin >> n;
  vector<string> v;
  v = get_vector(n);
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i] << endl;
  }
}
