An integer indicating the end of input, which is always -1.
A sequence of multiple datasets is given as input. Each dataset is represented as follows:

An integer X (0 ≤ X ≤ 11).
Three integers Y1, Y2, Y3 (0 ≤ Yi ≤ 11).
Five integers Z1, Z2, Z3, Z4, Z5 (0 ≤ Zi ≤ 11).
Three integers W1, W2, W3 (0 ≤ Wi ≤ 11).
An integer V (0 ≤ V ≤ 11).

There are no more than 100 datasets.

### Example Input:
```
6
2 1 3
10 5 7 0 8
9 4 11
0
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(datasets) that takes in a list of datasets. Each dataset is a tuple of integers.
def f(datasets: List[Tuple[int, List[int, int, int], List[int, int, int, int, int], List[int, int, int], int]]):
    '''
    datasets: a list of tuples representing each dataset
    '''