An integer \(N\) (0 ≤ \(N\) < 1,000,000), representing some quantity or size. 
A list of \(N\) integers where each integer is less than \(2^{31}\). 
The input terminates with a single line containing the integer 0.

### Example Input:

```
8
3 1 2 3 3 1 5 3
7
5 2 5 3 4 5 5
0
```

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