An integer n (1 ≤ n ≤ 100), followed by n integers each on a new line (1 ≤ ai ≤ 1,000,000). The input consists of multiple such 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 where each tuple contains:
        - an integer
        - a list of integers
    '''
```