Types: n: int, A: List[Tuple[str, int]]
Ranges: 1 ≤ n ≤ 100,000, 1 ≤ A[i][1] ≤ 10^9
Addtl Info: A[i][0] in {'S', 'H', 'C', 'D'}