An integer \( N \) (2 ≤ \( N \) ≤ 1000), representing some quantity or size.
A list of \( N \) values \( A \), where each value is either a character 'x' or an integer between -10^9 and 10^9.
The end of input is indicated by a single '0'.

### Example Input:

```
5
1 x 2 4 x
2
x x
0
```

### Function Signature:
Write a function f(inputs) that takes in the input.
```python
def f(inputs: List[Tuple[int, List[Union[int, str]]]]):
    '''
    inputs: a list of tuples, where each tuple contains:
        - an integer
        - a list of values (integers or the character 'x')
    '''
```