An integer N (1 ≤ N ≤ 18).
A list of integers A of size 2^N, where each integer is between 1 and 1e9.

### Example Input:

```
2
1
3
2
4
6
8
100
104
```

### Function Signature:
Write a function f(N, A) that takes in the input.

```python
def f(N: int, A: List[int]):
    ''' 
    N: an integer 
    A: a list of integers
    '''
```