An integer (0 ≤ integer ≤ 11).
Three integers on the next line (0 ≤ integer ≤ 11).
Five integers on the next line (0 ≤ integer ≤ 11).
Three integers on the next line (0 ≤ integer ≤ 11).
An integer (0 ≤ integer ≤ 11).
Repeat the above format for multiple datasets.
The end of the input is indicated by a single line with -1.
There are no more than 100 datasets.

### Example Input:
```
2
1 0 3
4 5 6 7 8
9 0 11
10
0
1 2 3
4 5 6 7 8
9 10 11
0
0
11 10 9
8 7 6 5 4
3 2 1
0
-1
```

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