An integer n (1 ≤ n ≤ 100), followed by n integers, each on a new line (1 ≤ each integer ≤ 1000000). The input consists of multiple datasets. The end of the input is indicated by a single zero. The number of datasets does not exceed 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
    '''
```