Please solve the programming task below using a self-contained code snippet in a markdown code block.

Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the "compressed" string would not become smaller than the original string, your method should return the original string. You can assume the string has only uppercase and lowercase letters (a - z).
Please complete the following python code precisely:
```python
class Solution:
    def compressString(self, S: str) -> str:
```