#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, l, b[11] = {0, 1}, c[11][9072101] = {};
  char a[11][9072101][11];
  scanf("%lld", &n);
  a[1][1][1] = 'a';
  c[1][1] = 1;
  if (n == 1)
    printf("a");
  else {
    for (i = 2; i <= n; i++) {
      for (j = 1; j <= b[i - 1]; j++) {
        for (k = 1; k <= c[i - 1][j] + 1; k++) {
          b[i]++;
          for (l = 1; l <= i - 1; l++) a[i][b[i]][l] = a[i - 1][j][l];
          a[i][b[i]][i] = 96 + k;
        }
      }
    }
    for (i = 1; i <= b[n]; i++) {
      for (j = 1; j <= n; j++) {
        printf("%c", a[n][i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
