#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using D = double;
using LD = long double;
using P = pair<int, int>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  vector<vector<string>> ans(n);
  ans[0].push_back("a");
  for (int i = 0; i < (n - 1); i++) {
    for (string t : ans[i]) {
      int x = t[t.size() - 1] - 'a';
      for (int j = 0; j < (x + 2); j++) {
        char c = 'a' + j;
        ans[i + 1].push_back(t + c);
      }
    }
  }
  for (string u : ans[n - 1]) {
    cout << u << endl;
  }
}
