Multiple datasets are given, each of the following format:

An integer n (1 ≤ n ≤ 100), followed by n integers, each (1 ≤ each integer ≤ 1000000). 
The number of datasets does not exceed 20.

The dataset is terminated by a single zero, and is provided in a processed format. 

### Example Input:

```
5
5
3
2
1
4
6
1
2
3
4
5
6
3
3
2
1
```

### 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
    '''
```