Relocation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Miss M lives on the planet Bitaqulandia and has decided to move from the country of Derzhprodiya to Tobolyandia.

For now, she has decided to move her four most important items. To transport them, she has chosen to use two boxes, where she will place all the items. It is known that the $$$i$$$-th item weighs $$$w_i$$$ kilograms and is located in the $$$t_i$$$-th box.

She will need to move the boxes one at a time, so she would very much like the boxes to not be too heavy. That is, she wants the maximum possible weight of a box to be as small as possible. Since she doesn't have much time, she can only move one item from one box to another.

Help her make the move easier and find out which item needs to be moved!

Input

The first line contains four integers $$$w_1$$$, $$$w_2$$$, $$$w_3$$$, $$$w_4$$$ ($$$1 \leq w_i \leq 10^6$$$) — the weights of each of the four items.

The second line contains four integers $$$t_1$$$, $$$t_2$$$, $$$t_3$$$, $$$t_4$$$ ($$$1 \leq t_i \leq 2$$$) — the box numbers in which the corresponding items are located.

Output

Print a single integer $$$p$$$ ($$$1 \leq p \leq 4$$$) — the number of the item that needs to be moved to another box.

If there are several correct answers, you can print any of them.

If it is optimal to not change anything, then print a single integer "-1".

Examples

Input

    5 2 4 31 2 2 1

Output

    -1

Input

    4 2 3 72 1 1 2

Output

    1

Note

To achieve the minimum maximum possible weight after moving one item from one box to another, in the second example there is only one option. In the initial distribution of items across the boxes, the weights of the boxes are $$$5$$$ and $$$11$$$. Consider all the options for moving items between boxes:

- If you move item number $$$1$$$ weighing $$$4$$$ from the second box to the first, then the weights of the boxes will be $$$4+2+3$$$ and $$$7$$$, $$$\max = 9$$$.
- If you move item number $$$2$$$ weighing $$$2$$$ from the first box to the second, then the weights of the boxes will be $$$4+7+2$$$ and $$$3$$$, $$$\max = 13$$$.
- If you move item number $$$3$$$ weighing $$$3$$$ from the first box to the second, then the weights of the boxes will be $$$4+7+3$$$ and $$$2$$$, $$$\max = 14$$$.
- If you move item number $$$4$$$ weighing $$$7$$$ from the second box to the first, then the weights of the boxes will be $$$2+3+7$$$ and $$$4$$$, $$$\max = 12$$$.

The first and second example from the problem statement.