Multiple datasets, each dataset consists of the following:

An integer ns (1 ≤ ns ≤ 10), representing some quantity or size.
An integer nl (1 ≤ nl ≤ 20), representing some quantity or size.
A list of nl tuples, each containing:
- Two integers si,1 and si,2 (1 ≤ si,1, si,2 ≤ ns), representing some identifiers.
- An integer di (di ≥ 1), representing some distance or weight.

The input terminates with two integers 0 0.

### Example Input:
```
6 5
1 3 10
2 3 12
3 4 2
4 5 13
4 6 11
10 10
1 2 11
2 3 25
2 5 81
2 6 82
4 5 58
5 9 68
6 7 80
6 9 67
8 9 44
9 10 21
0 0
```

### Function Signature:
Write a function f(inputs) that takes in the input.
def f(inputs: List[Tuple[int, int, List[Tuple[int, int, int]]]]): 
    '''
    inputs: a list of tuples, where each tuple contains:
        - an integer ns
        - an integer nl
        - a list of nl tuples, each containing:
            * two integers si,1 and si,2
            * an integer di
    '''