#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> A, B;
  string C = {"abcdefghijklm"};
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      A.push_back("a");
      continue;
    }
    B.clear();
    for (auto j : A) {
      int a = 0;
      for (int k = 0; k < j.size(); k++) a = max(0, j[k] - 'a');
      for (int k = 0; k < a + 2; k++) {
        char b = C[k];
        B.push_back(j + b);
      }
    }
    A = B;
  }
  for (int i = 0; i < A.size(); i++) cout << A[i] << endl;
}
