An integer \( q \) (1 ≤ \( q \) ≤ 200,000), representing the number of queries.
A list of \( q \) queries, each query being one of the following:
- A tuple (0, \( x \)) where \( x \) is an integer (0 ≤ \( x \) ≤ 1,000,000,000).
- A tuple (1, \( x \)) where \( x \) is an integer (0 ≤ \( x \) ≤ 1,000,000,000).
- A tuple (2, \( x \)) where \( x \) is an integer (0 ≤ \( x \) ≤ 1,000,000,000).
- A tuple (3, \( L \), \( R \)) where \( L \) and \( R \) are integers (0 ≤ \( L \), \( R \) ≤ 1,000,000,000).

### Example Input:

```
9
0 1
0 2
0 3
2 2
1 1
1 2
1 3
0 4
3 2 4
```

### Function Signature:
Write a function f(q, queries) that takes in the input. 
```python
def f(q: int, queries: List[Tuple[int, ...]]):
    '''
    q: an integer
    queries: a list of tuples, where each tuple represents a query
    '''
```