An integer n (3 ≤ n ≤ 100), representing the number of nodes.
An integer m, representing the number of edges.
An integer p, representing the number of specific points of interest.
m lines, each containing three integers. The first two integers represent nodes connected by an edge, and the third integer represents the weight of the edge (0 < weight < 10000).
p lines, each containing one integer representing a point of interest.
Input terminates when n = m = p = 0.

### Example Input:
```
3 2 1
0 1 2
1 2 3
1
4 5 2
0 1 1
0 2 1
1 2 1
1 3 1
2 3 1
1
2
0 0 0
```

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