Naturally, the magical girl is very good at performing magic. She recently met her master wizard Devu, who gifted her R potions of red liquid, 
B potions of blue liquid, and G potions of green liquid.

- 
The red liquid potions have liquid amounts given by r[1], ..., r[R] liters. 

- 
The green liquid potions have liquid amounts given by g[1], ..., g[G] liters. 

- 
The blue liquid potions have liquid amounts given by b[1], ..., b[B] liters. 

She want to play with the potions by applying magic tricks on them. In a single magic trick, she will choose a particular color. Then she will pick all the potions of the chosen color and decrease the amount of liquid in them to half (i.e. if initial amount 
of liquid is x, then the amount after decrement will be x / 2  where division is integer division, e.g. 3 / 2 = 1 and 4 / 2 = 2). 

Because she has to go out of station to meet her uncle Churu, a wannabe wizard, only M minutes are left for her. In a single minute, she can perform at most one magic trick. Hence, she can perform at most M magic tricks.

She would like to minimize the maximum amount of liquid among all of Red, Green and Blue colored potions. Formally Let v be the maximum value of amount of liquid in any potion. We want to minimize the value of v.
Please help her.

-----Input-----

First line of the input contains an integer T denoting the number of test cases.
Then for each test case, we have four lines.

The first line contains four space separated integers R, G, B, M. The next 3 lines will describe the amount of different color liquids (r, g, b), which are separated by space.

-----Output-----
For each test case, print a single integer denoting the answer of the problem.

-----Constraints-----
-  1 ≤ T ≤ 1000 
-  1 ≤ R, G, B, M ≤ 100 
-  1 ≤ r[i], g[i], b[i] ≤ 10^9 

-----Example-----
Input:
3
1 1 1 1
1
2
3
1 1 1 1
2
4
6
3 2 2 2
1 2 3
2 4
6 8
Output:
2
4
4

-----Explanation-----
Example case 1. Magical girl can pick the blue potion and make its liquid amount half. So the potions will now have amounts 1 2 1. Maximum of these values is 2. Hence answer is 2.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import sys\nimport math\nimport heapq\ndef half(arr):\n for i in range(len(arr)):\n  arr[i]//=2\n return arr\ndef main(arr,m):\n x,y,z=arr\n x.sort()\n y.sort()\n z.sort()\n \n while m!=0:\n  \n  a,b,c=x[-1],y[-1],z[-1]\n  \n  s=max(a,b,c)\n  \n  if s==a:\n   half(x)\n  elif s==b:\n   half(y)\n  else:\n   half(z)\n  m-=1\n return max(x[-1],y[-1],z[-1])\n   \n \n \n \n \n\nfor i in range(int(input())):\n r,g,b,m=list(map(int,input().split()))\n arr=[]\n for j in range(3):\n  c=list(map(int,input().split()))\n  arr.append(c)\n \n print(main(arr,m))\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13463