An integer ns (1 ≤ ns ≤ 10), representing some quantity.
An integer nl (1 ≤ nl ≤ 20), representing some other quantity.
A list of tuples of integers (si,1, si,2, di) of size nl, where each tuple consists of:
- si,1 (an integer, 1 ≤ si,1 ≤ ns)
- si,2 (an integer, 1 ≤ si,2 ≤ ns, si,2 ≠ si,1)
- di (an integer, di ≥ 1)
The input terminates with a pair of zeros (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:
        - ns: an integer
        - nl: an integer
        - routes: a list of tuples of integers
    '''