### Canonicalized Input Description:

An integer N (1 ≤ N ≤ 500), representing some quantity or size.
An integer M (0 ≤ M ≤ 3000), representing some quantity or size.
A list of M tuples (s_i, t_i), where each tuple consists of two integers (1 ≤ s_i, t_i ≤ N).

### Example Input:

```
9
13
1 2
1 3
2 9
3 4
3 5
3 6
4 9
5 7
6 7
6 8
7 9
8 9
9 1
```

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