An integer N (1 ≤ N ≤ 1000), representing some quantity or size.
A list of tuples of three integers of size N, where each integer is between 0 and 10^9 for the first two integers and between 1 and 10 for the third integer.
Another list of tuples of three integers of size N, where each integer is between 0 and 10^9 for the first two integers and between 1 and 10 for the third integer.

### Example Input:

```
2
0 0 1
3 2 1
2 2 1
5 0 1
```

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