#include <bits/stdc++.h>
using namespace std;
int ans[500005][15], c[500005][15];
long long b[500005];
int main() {
  int n;
  scanf("%d", &n);
  int t = 1, cnt;
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i < n - 1; i++) {
    for (int j = 1; j < (1 << (n - 1)); j++) {
      int mm = 0;
      for (int k = 0; k < n; k++) {
        if (j & (1 << k)) mm++;
      }
      if (mm == i) {
        t++;
        cnt = i;
        for (int k = 0; k < n; k++) {
          if (j & (1 << k)) ans[t][k + 1] = cnt, cnt--;
        }
      }
    }
  }
  if (n == 1)
    printf("%c\n", 'a');
  else {
    t++;
    for (int i = 0; i < n; i++) {
      b[t] = b[t] * 10 + i;
    }
    for (int i = 1; i < t; i++) {
      for (int j = n; j >= 1; j--) {
        b[i] = b[i] * 10 + ans[i][j];
      }
    }
    sort(b + 1, b + 1 + t);
    for (int i = 1; i <= t; i++) {
      for (int j = 1; j <= n; j++) {
        c[i][j] = b[i] % 10;
        b[i] /= 10;
      }
    }
    for (int i = 1; i <= t; i++) {
      for (int j = n; j >= 1; j--) {
        printf("%c", c[i][j] + 'a');
      }
      printf("\n");
    }
  }
}
