Sure! Let's create a test case generator for the "Frequency of Appearance Operation" problem.

To generate test cases, we need to consider the constraints and structure of the input:

1. **Number of datasets**: Maximum of 200 datasets.
2. **Length of each sequence `n`**: Each sequence has a length `n` where \(1 \leq n \leq 12\).
3. **Elements of each sequence `si`**: Each element \(1 \leq si \leq 100\).

Here's a Python function to generate test cases based on these constraints:

```python
import random

def tcgen():
    test_cases = []
    
    # Number of datasets
    num_datasets = random.randint(1, 200)
    
    for _ in range(num_datasets):
        # Length of sequence n
        n = random.randint(1, 12)
        
        # Sequence S of length n with elements between 1 and 100
        S = [random.randint(1, 100) for _ in range(n)]
        
        test_cases.append((n, S))
    
    return test_cases

# Generate test cases
test_cases = tcgen()

# Print the test cases in the required format
for n, S in test_cases:
    print(n)
    print(' '.join(map(str, S)))
print(0)  # End of input indicator
```

### Explanation:
1. **Number of datasets**: We randomly decide how many datasets to generate, ranging from 1 to 200.
2. **Length of sequence `n`**: For each dataset, we randomly choose a length `n` between 1 and 12.
3. **Elements of sequence `si`**: For each sequence, we generate `n` random integers between 1 and 100.
4. **Appending to test_cases**: Each dataset is appended to the `test_cases` list.
5. **Printing**: Finally, the test cases are printed in the required format, ending with a single `0` to indicate the end of input.

### Example Output:
```
5
3 45 67 23 89
10
1 1 1 1 1 1 1 1 1 1
12
100 99 98 97 96 95 94 93 92 91 90 89
0
```

This generator should produce diverse test cases that adhere to the problem constraints, making it a valuable tool for testing the correctness and efficiency of solutions to the "Frequency of Appearance Operation" problem.