#include <bits/stdc++.h>
void print_all(char str[], int cur, int n) {
  if (cur == n) {
    printf("%s\n", str);
    return;
  }
  for (int i = 0; i <= str[cur - 1] - 'a' + 1; i++) {
    char temp[11];
    strcpy(temp, str);
    temp[cur] = 'a' + i;
    print_all(temp, cur + 1, n);
  }
}
int main(void) {
  int n;
  char str[11] = "aaaaaaaaaa";
  scanf("%d", &n);
  str[n] = 0;
  print_all(str, 1, n);
  return 0;
}
