An integer n (1 ≤ n ≤ 10^9), representing some quantity or size.
An integer m (1 ≤ m ≤ 2 * 10^5), representing another quantity or size.
Two integers x and y (1 ≤ x, y ≤ 10^5).
m pairs of integers (c_i, l_i, r_i):
  - An integer c_i (c_i ∈ {1, 2, 3}), representing a category.
  - Two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ n).

### Example Input:

```
8 5 10 5
1 1 7
3 1 2
1 5 6
3 1 4
3 6 8
```

### Function Signature:
Write a function f(n, m, x, y, operations) that takes in the input. 
def f(n: int, m: int, x: int, y: int, operations: List[Tuple[int, int, int]]): 
    ''' 
    n: an integer 
    m: an integer
    x: an integer
    y: an integer
    operations: a list of tuples, each tuple containing three integers
    '''