#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long INF = 1e17;
const long long NUM = 1e5 + 1;
long long dp[10005];
long long Query[NUM];
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
void createString(int remain, int used, int indexRemain, string str) {
  if (indexRemain == 0) {
    cout << str << endl;
  } else {
    int a = (int)'a';
    if (remain > indexRemain) {
      return;
    } else if (remain == indexRemain) {
      char c = a + used;
      createString(remain - 1, used + 1, indexRemain - 1, str + c);
    } else {
      char c;
      for (int i = 0; i < used; i++) {
        c = a + i;
        for (int j = remain; j < remain + indexRemain; j++) {
          createString(j, used, indexRemain - 1, str + c);
        }
      }
      if (remain > 0) {
        c = a + used;
        for (int j = remain - 1; j < remain - 1 + indexRemain; j++) {
          createString(j, used + 1, indexRemain - 1, str + c);
        }
      }
    }
  }
}
signed main(void) {
  int N;
  cin >> N;
  createString(1, 0, N, "");
}
