An integer N (2 ≤ N ≤ 100,000), representing some quantity or size.
An integer M (1 ≤ M ≤ 200,000), representing some other quantity or size.
An integer C (any integer), representing a cost or constant.
A list of M tuples, each containing three integers: Ai, Bi (1 ≤ Ai, Bi ≤ N), and Di (positive integer), representing connections and weights.

### Example Input:

```
5 6 10
1 2 4
1 3 3
2 4 2
3 4 4
3 5 1
4 5 3
```

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