    
An integer Q (1 ≤ Q ≤ 100), representing some quantity or size.
A list of Q tuples, where each tuple contains two integers (A, M):
- The first integer A is between 0 and 10^9.
- The second integer M is between 1 and 10^9.

### Example Input:

```
4
2 4
3 8
9 6
10 7
```

### Function Signature:

Write a function `f(inputs)` that takes in the input.

```python
def f(inputs: List[Tuple[int, int]]):
    '''
    inputs: a list of tuples, where each tuple contains two integers (A, M)
    '''
```