#include <bits/stdc++.h>
void dfs(int rank, int maxrank, char bef, char *buf) {
  buf[rank] = bef;
  if (rank + 1 == maxrank) {
    buf[maxrank] = '\0';
    puts(buf);
    return;
  }
  for (char i = 'a'; i <= bef + 1; i++) dfs(rank + 1, maxrank, i, buf);
}
int main(void) {
  int n;
  scanf("%d", &n);
  char buf[n + 1];
  dfs(0, n, 'a', buf);
  return 0;
}
