#include <bits/stdc++.h>
int main(void) {
  int n;
  char *s;
  scanf("%d", &n);
  s = (char *)malloc(sizeof(char) * n + 1);
  for (int i = 0; i < n; i++) {
    s[i] = 'a';
  }
  s[n] = 0;
  char p = 'a';
  int l = n - 1;
  int flg;
  if (l == 0) {
    printf("%s\n", s);
  }
  while (l > 0) {
    flg = 1;
    for (int i = l - 1; i < n - 1; i++) {
      s[n - 1] = p;
      if (s[i] + 1 < s[i + 1]) {
        flg = 0;
        l--;
        p = 'a';
        s[i + 1] = 'a';
        s[i]++;
        break;
      }
    }
    if (flg == 1) {
      printf("%s\n", s);
      p++;
      l = n - 1;
    }
  }
  return 0;
}
