An integer N (1 ≤ N ≤ 10^5), representing some quantity or size.
N lines each containing a string Ci (length between 1 and 20) and an integer Di (1 ≤ Di ≤ 10^5).
An integer M (1 ≤ M ≤ 10^5), representing some quantity or size.
M lines each containing a string Oi (length between 1 and 20).

### Example Input:

```
2
white 20
black 10
2
black
white
```

### Function Signature:
Write a function f(N, A, M, O) that takes in the input.
def f(N: int, A: List[Tuple[str, int]], M: int, O: List[str]):
    '''
    N: an integer
    A: a list of tuples, where each tuple contains a string and an integer
    M: an integer
    O: a list of strings
    '''