#include <bits/stdc++.h>
using namespace std;
const long long MAX = 3000000;
const long long MOD = 1000000007;
typedef std::priority_queue<string, std::vector<string>, std::greater<string> >
    IntReversePrioQueue;
long long n;
int main() {
  cin >> n;
  string alp = "abcdefghijklmnopqrstuvwxyz";
  vector<string> series;
  vector<int> num;
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      string s = alp.substr(0, 1);
      series.push_back(s);
      num.push_back(0);
    } else {
      long long kaisu = series.size();
      for (long long j = 0; j < kaisu; j++) {
        string tempS = series[0];
        long long tempN = num[0];
        series.erase(series.begin());
        num.erase(num.begin());
        for (long long k = 0; k < tempN + 2; k++) {
          series.push_back(tempS + "" + alp[k]);
          num.push_back(max(tempN, k));
        }
      }
    }
  }
  for (long long i = 0; i < series.size(); i++) {
    cout << series[i] << endl;
  }
  return 0;
}
