#include <bits/stdc++.h>
using namespace std;
long long myPow(long long x, long long n) {
  long long r = 1;
  while (n > 0)
    if (0 == n % 2) {
      x *= x;
      x %= 1000000007;
      n /= 2;
    } else {
      r *= x;
      r %= 1000000007;
      n--;
    }
  return r;
}
void F(const string pre, const char c, const int n, vector<string> &S) {
  if (0 == n) {
    S.push_back(pre);
    return;
  }
  string pre1 = pre;
  for (int i = 1; i <= n; i++) {
    pre1 += c;
    F(pre1, c + 1, n - i, S);
  }
  return;
}
int main() {
  int N;
  cin >> N;
  vector<string> S;
  F("", 'a', N, S);
  sort(S.begin(), S.end());
  for (int i = 0; i < S.size(); i++) cout << S.at(i) << endl;
  return 0;
}
