#include <bits/stdc++.h>
using namespace std;
long long mypow(long long a, long long b, long long c) {
  if (b == 0) return 1;
  if (b % 2) return mypow(a, b - 1, c) * a % c;
  long long z = mypow(a, b / 2, c);
  return z * z % c;
}
void mutu(long long n, long long z, string s) {
  if (n == 0) {
    cout << s << endl;
    return;
  } else {
    for (long long i = 0; i < z + 2; i++) {
      mutu(n - 1, i, s + char('a' + i));
    }
  }
}
signed main() {
  long long n;
  cin >> n;
  mutu(n - 1, 0, "a");
}
