An integer N (2 ≤ N ≤ 100), representing some quantity or size.
An integer M (1 ≤ M ≤ 1000), representing some quantity or size.
A list of M tuples where each tuple consists of three integers (x, y, s):
  - x (0 ≤ x < y ≤ N - 1), an integer representing some index.
  - y (0 ≤ x < y ≤ N - 1), an integer representing some index.
  - s (1 ≤ s ≤ 1000), an integer representing some quantity.

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

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