#include <bits/stdc++.h>
using namespace std;
bool isPowerOfTwo(long long n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
long long power(long long x, unsigned long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
signed main() {
  long long k;
  cin >> k;
  vector<string> v[10];
  v[0].push_back("a");
  v[1].push_back("aa");
  v[1].push_back("ab");
  if (k == 1) {
    cout << 'a' << endl;
    return 0;
  }
  if (k == 2) {
    cout << "aa" << endl << "ab" << endl;
    return 0;
  }
  for (long long n = 3; n <= 10; n++) {
    if (n >= 3) {
      for (long long i = 0; i < v[n - 2].size(); i++) {
        long long x = v[n - 2][i].size();
        string s = v[n - 2][i];
        long long y = v[n - 2][i][x - 1] - 'a' + 2;
        for (long long j = 0; j < y; j++) {
          char c = 'a' + j;
          v[n - 1].push_back(s + c);
        }
      }
    }
  }
  for (long long i = 0; i < v[k - 1].size(); i++) cout << v[k - 1][i] << endl;
}
