#include <bits/stdc++.h>
using namespace std;
char moji(long long i) {
  switch (i) {
    case 0:
      return 'a';
    case 1:
      return 'b';
    case 2:
      return 'c';
    case 3:
      return 'd';
    case 4:
      return 'e';
    case 5:
      return 'f';
    case 6:
      return 'g';
    case 7:
      return 'h';
    case 8:
      return 'i';
    case 9:
      return 'j';
  }
}
int main() {
  long long N;
  cin >> N;
  long long i_sub;
  long long MAX = 0;
  long long keta[N];
  long long count;
  long long use;
  for (long long i = 1; i <= N - 1; i++) {
    MAX = N * MAX + i;
  }
  if (N == 1) {
    cout << 'a' << endl;
  } else {
    for (long long i = 0; i <= MAX; i++) {
      i_sub = i;
      use = 1;
      count = 0;
      for (long long j = 1; j <= N - 1; j++) {
        keta[j] = i_sub % N;
        i_sub = (i_sub - (i_sub % N)) / N;
      }
      for (long long j = N - 1; j >= 1; j--) {
        if (count == keta[j] - 1 && use == 1) {
          count++;
        } else if (count < keta[j] - 1 && use == 1) {
          use = 0;
        }
      }
      if (use == 1) {
        cout << 'a';
        for (long long j = N - 1; j >= 1; j--) {
          cout << moji(keta[j]);
        }
        cout << endl;
      }
    }
  }
  system("pause");
  return 0;
}
