An integer n (1 ≤ n ≤ 100), followed by n integers, each between 1 and 1,000,000. The end of input is indicated by a single zero. The input consists of multiple datasets, not exceeding 20.

### Example Input:

```
5
5
3
2
1
4
6
1
2
3
4
5
6
3
3
2
1
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, each containing an integer and a list of integers
    '''
```