An integer N (2 ≤ N ≤ 10), representing some quantity or size.
An integer M (1 ≤ M ≤ 10), representing some upper limit.
An integer Q (1 ≤ Q ≤ 50), representing the number of quadruples.
Q quadruples of integers (a_i, b_i, c_i, d_i) where:
- 1 ≤ a_i < b_i ≤ N
- 0 ≤ c_i ≤ M - 1
- 1 ≤ d_i ≤ 10^5

### Example Input:

```
3 4 3
1 3 3 100
1 2 2 10
2 3 2 10
```

### Function Signature:
Write a function f(N, M, Q, quadruples) that takes in the input.
```python
def f(N: int, M: int, Q: int, quadruples: List[Tuple[int, int, int, int]]):
    '''
    N: an integer
    M: an integer
    Q: an integer
    quadruples: a list of tuples, each containing four integers
    '''
```