Multiple datasets, each dataset consists of the following:

An integer N (1 ≤ N ≤ 6), an integer M (2 ≤ M ≤ 10^9), and an integer L (1 ≤ L ≤ 10^9).
A list of lists of non-negative integers, where the number of lists is 2N - 1, the first list contains N integers, the second list contains N + 1 integers, and so on, up to the N-th list which contains 2N - 1 integers, then down to one integer.

### Example Input:

```
3 3 1
1 0 0
0 0 0 0
0 0 0 0 0
0 0 0 0
0 0 1
3 3 2
1 0 0
0 0 0 0
0 0 0 0 0
0 0 0 0
0 0 1
```

### Function Signature:
Write a function f(inputs) that takes in the input.
def f(inputs: List[Tuple[int, int, int, List[List[int]]]]): 
    ''' 
    inputs: a list of tuples, where each tuple contains:
        - an integer N
        - an integer M
        - an integer L
        - a list of lists of integers
    '''