#include <bits/stdc++.h>
char f(int x) {
  char S;
  S = 'a' + x - 1;
  return S;
}
int main(void) {
  char s[11][2268000][11];
  int a[11][2268000];
  int c[11];
  int n, i, j, k, l, p;
  s[1][1][1] = 'a';
  a[1][1] = 1;
  c[1] = 1;
  for (i = 2; i <= 10; i++) {
    p = 0;
    for (j = 1; j <= c[i - 1]; j++) {
      for (k = 1; k <= a[i - 1][j] + 1; k++) {
        for (l = 1; l <= i - 1; l++) {
          s[i][p + k][l] = s[i - 1][j][l];
        }
        s[i][p + k][i] = f(k);
        if (k == a[i - 1][j] + 1) {
          a[i][p + k] = a[i - 1][j] + 1;
        } else {
          a[i][p + k] = a[i - 1][j];
        }
      }
      p = p + a[i - 1][j] + 1;
    }
    c[i] = p;
  }
  scanf("%d", &n);
  for (j = 1; j <= c[n]; j++) {
    for (l = 1; l <= n; l++) {
      printf("%c", s[n][j][l]);
    }
    printf("\n");
  }
  return 0;
}
