#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, j, k, l;
  cin >> N;
  char m;
  vector<vector<string> > V(N);
  N--;
  vector<string> w = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  V[0] = {"a"};
  V[1] = {"aa", "ab"};
  for (i = 2; i <= N; i++) {
    for (j = 0; j < V[i - 1].size(); j++) {
      for (m = 'a', k = 0; k < i; k++) {
        m = max(m, V[i - 1][j][k]);
      }
      for (l = m - 'a' + 2, k = 0; k < l; k++) {
        V[i].push_back(V[i - 1][j] + w[k]);
      }
    }
  }
  for (i = 0; i < V[N].size(); i++) {
    cout << V[N][i] << "\n";
  }
}
