char p[15];
int n, tok = 0;

void dfs(int lst) {
  if (tok == n) {
    for (int i = 0; i < n; ++i) {
      printf("%c", p[i]);
    }
    puts("");
    return;
  }
  for (int i = 0; i <= lst+1; ++i) {
    p[tok++] = (char)('a'+i);
    dfs(i);
    --tok;
  }
}

main() {
  scanf("%d", &n);
  dfs(-1);
}