### Canonicalized Input Description:

An integer n (3 ≤ n ≤ 100), representing some quantity or size.
An integer m, representing some quantity or size.
An integer p, representing some quantity or size.
m lines follow, each containing three integers: the first two integers represent nodes, and the third integer is a weight (0 < weight < 10000).
p lines follow, each containing one integer.

### Example Input:

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

### Function Signature:
Write a function f(inputs) that takes in the input.
def f(inputs: List[Tuple[int, List[Tuple[int, int, int]], List[int]]]):
    '''
    inputs: a list of tuples, each containing:
        - an integer n
        - a list of tuples, each containing three integers
        - a list of integers
    '''