#include <bits/stdc++.h>
int n;
int main(void) {
  char str[20] =
      {
          0,
      },
       copy[20] = {
           0,
       };
  scanf("%d", &n);
  if (n == 1) {
    printf("a");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    str[i] = 'a';
  }
  for (int i = 1; i < n; i++) {
    while (1) {
      printf("%s\n", str);
      str[n - 1]++;
      int t = n - 1;
      for (int j = 0; j < n; j++) copy[j] = str[j];
      while (str[t] == i + 'a' + 1) {
        str[t] = 'a';
        str[t - 1]++;
        t = t - 1;
      }
      if (str[i - 1] == i + 'a') {
        for (int j = 0; j < n; j++) str[j] = copy[j];
        break;
      }
    }
  }
  return 0;
}
