
An integer N (2 ≤ N ≤ 10), an integer M (1 ≤ M ≤ 10), an integer Q (1 ≤ Q ≤ 50), and Q quadruples of integers (a_i, b_i, c_i, d_i).

### 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, inputs) that takes in the input. 
def f(N: int, M: int, Q: int, inputs: List[Tuple[int, int, int, int]]): 
    ''' 
    N: an integer 
    M: an integer 
    Q: an integer 
    inputs: a list of tuples of four integers
    '''