#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  string alfa = "abcdefghij";
  string moto = "";
  for (long long i = 0; i < N; i++) moto += alfa.at(i);
  vector<string> ans;
  ans.push_back(moto);
  if (N == 1) {
    cout << "a" << endl;
    return 0;
  }
  for (long long i = N - 2; i >= 0; i--) {
    for (long long j = i + 1; j < N; j++) {
      moto.at(j) = moto.at(i);
      ans.push_back(moto);
    }
  }
  sort(ans.begin(), ans.end());
  for (long long i = 0; i < ans.size(); i++) cout << ans.at(i) << endl;
}
