Problem: One drew a closed polyline on a plane, that consisted only of vertical and horizontal segments (parallel to the coordinate axes). The segments alternated between horizontal and vertical ones (a horizontal segment was always followed by a vertical one, and vice versa). The polyline did not contain strict self-intersections, which means that in case any two segments shared a common point, that point was an endpoint for both of them (please consult the examples in the notes section).

Unfortunately, the polyline was erased, and you only know the lengths of the horizonal and vertical segments. Please construct any polyline matching the description with such segments, or determine that it does not exist.

Input

The first line contains one integer t (1 ≤ t ≤ 200) —the number of test cases.

The first line of each test case contains one integer h (1 ≤ h ≤ 1000) — the number of horizontal segments. The following line contains h integers l_1, l_2, ..., l_h (1 ≤ l_i ≤ 1000) — lengths of the horizontal segments of the polyline, in arbitrary order.

The following line contains an integer v (1 ≤ v ≤ 1000) — the number of vertical segments, which is followed by a line containing v integers p_1, p_2, ..., p_v (1 ≤ p_i ≤ 1000) — lengths of the vertical segments of the polyline, in arbitrary order.

Test cases are separated by a blank line, and the sum of values h + v over all test cases does not exceed 1000.

Output

For each test case output Yes, if there exists at least one polyline satisfying the requirements, or No otherwise. If it does exist, in the following n lines print the coordinates of the polyline vertices, in order of the polyline traversal: the i-th line should contain two integers x_i and y_i — coordinates of the i-th vertex.

Note that, each polyline segment must be either horizontal or vertical, and the segments should alternate between horizontal and vertical. The coordinates should not exceed 10^9 by their absolute value.

Examples

Input


2
2
1 1
2
1 1

2
1 2
2
3 3


Output


Yes
1 0
1 1
0 1
0 0
No


Input


2
4
1 1 1 1
4
1 1 1 1

3
2 1 1
3
2 1 1


Output


Yes
1 0
1 1
2 1
2 2
1 2
1 1
0 1
0 0
Yes
0 -2
2 -2
2 -1
1 -1
1 0
0 0


Input


2
4
1 4 1 2
4
3 4 5 12

4
1 2 3 6
2
1 3


Output


Yes
2 0
2 3
3 3
3 7
4 7
4 12
0 12
0 0
No

Note

In the first test case of the first example, the answer is Yes — for example, the following picture illustrates a square that satisfies the requirements: 

<image>

In the first test case of the second example, the desired polyline also exists. Note that, the polyline contains self-intersections, but only in the endpoints: 

<image>

In the second test case of the second example, the desired polyline could be like the one below: 

<image>

Note that the following polyline is not a valid one, since it contains self-intersections that are not endpoints for some of the segments: 

<image>

Solution (in PYTHON3):

Solution:
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase


def main():
    t = int(input())
    for _ in range(t):
        if _ != 0:
            input()
        h = int(input())
        l1 = list(map(int,input().split()))
        v = int(input())
        l2 = list(map(int,input().split()))
        hKnap = [1]
        vKnap = [1]
        if h != v or sum(l1) % 2 != 0 or sum(l2) % 2 != 0:
            print("No")
            continue
        for elem in l1:
            hKnap.append((hKnap[-1] << elem) | hKnap[-1])
        for elem in l2:
            vKnap.append((vKnap[-1] << elem) | vKnap[-1])
        hSet = []
        hSet2 = []
        vSet = []
        vSet2 = []
        if hKnap[-1] & 1 << (sum(l1) // 2):
            curSum = sum(l1) // 2
            for i in range(h - 1, -1, -1):
                if curSum >= l1[i] and hKnap[i] & (1 << (curSum - l1[i])):
                    curSum -= l1[i]
                    hSet.append(l1[i])
                else:
                    hSet2.append(l1[i])
        if vKnap[-1] & 1 << (sum(l2) // 2):
            curSum = sum(l2) // 2
            for i in range(v - 1, -1, -1):
                if curSum >= l2[i] and vKnap[i] & (1 << (curSum - l2[i])):
                    curSum -= l2[i]
                    vSet.append(l2[i])
                else:
                    vSet2.append(l2[i])
        if not hSet or not vSet:
            print("No")
        else:
            print("Yes")
            if len(hSet) < len(hSet2):
                hTupleS = tuple(sorted(hSet))
                hTupleL = tuple(sorted(hSet2))
            else:
                hTupleS = tuple(sorted(hSet2))
                hTupleL = tuple(sorted(hSet))
            if len(vSet) < len(vSet2):
                vTupleS = tuple(sorted(vSet))
                vTupleL = tuple(sorted(vSet2))
            else:
                vTupleS = tuple(sorted(vSet2))
                vTupleL = tuple(sorted(vSet))
            currentLoc = [0,0]
            isHS = True
            isHL = False
            isVS = False
            isVL = True
            hIndex = len(hTupleS)-1
            vIndex = 0
            for i in range(h):
                if isHS:
                    currentLoc[0] += hTupleS[hIndex]
                    hIndex -= 1
                    if hIndex < 0:
                        hIndex = len(hTupleL) - 1
                        isHS = False
                        isHL = True
                elif isHL:
                    currentLoc[0] -= hTupleL[hIndex]
                    hIndex -= 1
                print(str(currentLoc[0]) + " " + str(currentLoc[1]))
                if isVL:
                    currentLoc[1] += vTupleL[vIndex]
                    vIndex += 1
                    if vIndex >= len(vTupleL):
                        vIndex = 0
                        isVL = False
                        isVH = True
                elif isHL:
                    currentLoc[1] -= vTupleS[vIndex]
                    vIndex += 1
                print(str(currentLoc[0]) + " " + str(currentLoc[1]))

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()