#include <bits/stdc++.h>
char str[20];
int n, f[20];
void check(int p, char ch) {
  if (p == n) {
    memset(f, 0, sizeof f);
    for (int i = 1; i < n; ++i) f[str[i] - 'a'] = 1;
    int num = 0;
    for (int i = 1; i <= n; ++i) num += f[i];
    for (int i = 0; i <= num + 1; ++i) {
      str[p] = ch + i;
      for (int i = 1; i <= n; ++i) printf("%c", str[i]);
      printf("\n");
    }
    return;
  }
  for (int i = 0; i <= p - 1; ++i) {
    str[p] = ch + i;
    check(p + 1, ch);
  }
}
int main() {
  scanf("%d", &n);
  str[1] = 'a';
  if (n >= 2)
    check(2, 'a');
  else
    printf("a");
  return 0;
}
