#include <bits/stdc++.h>
void put(char bef, int rank, int maxrank, char *buf) {
  buf[rank] = bef;
  if (rank == maxrank - 1) {
    printf("%s\n", buf);
    return;
  }
  if (bef != 'a') put(bef - 1, rank + 1, maxrank, buf);
  put(bef, rank + 1, maxrank, buf);
  put(bef + 1, rank + 1, maxrank, buf);
}
int main(void) {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    puts("a");
    return 0;
  }
  if (n == 2) {
    puts("aa\nab");
    return 0;
  }
  char buf[n];
  put('a', 0, n, buf);
  return 0;
}
