#include <bits/stdc++.h>
int main() {
  int N;
  scanf("%d", &N);
  int i, j, digit[10] = {}, tmp;
  while (1) {
    for (i = 0; i < N; i++) printf("%c", 'a' + digit[i]);
    printf("\n");
    for (i = N - 1; i > 0; i--)
      if (digit[i] == digit[i - 1]) break;
    if (i == 0) break;
    for (tmp = ++digit[i++]; i < N; digit[i++] = tmp)
      ;
  }
  fflush(stdout);
  return 0;
}
