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 JAVA):

Solution:
import java.io.*;
import java.util.*;

public class A {
	public static void main (String[] args) { new A(); }

	public A() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");
		
		int T = fs.nextInt();
		while(T-->0) {
			
			int H = fs.nextInt();
			int[] hs = fs.nextIntArray(H);
			int V = fs.nextInt();
			int[] vs = fs.nextIntArray(V);
			
			if(H != V) {
				out.println("No");
				continue;
			}
			
			Pair HSegs = knapsack(hs);
			Pair VSegs = knapsack(vs);
			
			if(HSegs == null || VSegs == null) {
				out.println("No");
				continue;
			}
			
			if(HSegs.sack1.size() > HSegs.sack2.size()) {
				ArrayList<Integer> tmp = HSegs.sack1;
				HSegs.sack1 = HSegs.sack2;
				HSegs.sack2 = tmp;
			}
			if(VSegs.sack1.size() > VSegs.sack2.size()) {
				ArrayList<Integer> tmp = VSegs.sack1;
				VSegs.sack1 = VSegs.sack2;
				VSegs.sack2 = tmp;
			}
			
			Pair rightUp, upRight, connects;
			Collections.sort(HSegs.sack1, Collections.reverseOrder());
			Collections.sort(VSegs.sack2);
			
			rightUp = new Pair();
			for(int i = 0; i < HSegs.sack1.size(); i++) {
				rightUp.sack1.add(HSegs.sack1.get(i));
				rightUp.sack2.add(VSegs.sack2.get(i));
			}
			
			upRight = new Pair();
			Collections.sort(VSegs.sack1, Collections.reverseOrder());
			Collections.sort(HSegs.sack2);
			for(int i = 0; i < VSegs.sack1.size(); i++) {
				upRight.sack1.add(VSegs.sack1.get(i));
				upRight.sack2.add(HSegs.sack2.get(i));
			}
			
			int idxH2 = VSegs.sack1.size();
			int idxV2 = VSegs.sack2.size()-1;
			
			connects = new Pair();
			while(idxH2 < HSegs.sack2.size()) {
				connects.sack1.add(HSegs.sack2.get(idxH2));
				connects.sack2.add(VSegs.sack2.get(idxV2));
				
				idxH2++;
				idxV2--;
			}
			
			ArrayList<Point> sweep1 = new ArrayList<>();
			sweep1.add(new Point(0, 0));
			for(int i = 0; i < rightUp.sack1.size(); i++) {
				Point prev = sweep1.get(sweep1.size()-1);
				Point nxt = new Point(prev.x, prev.y);
				
				nxt.x += rightUp.sack1.get(i);
				sweep1.add(new Point(nxt.x, nxt.y));
				
				nxt.y += rightUp.sack2.get(i);
				sweep1.add(new Point(nxt.x, nxt.y));
			}
			
			for(int i = 0; i < connects.sack1.size(); i++) {
				Point prev = sweep1.get(sweep1.size()-1);
				Point nxt = new Point(prev.x, prev.y);
				
				nxt.x -= connects.sack1.get(i);
				sweep1.add(new Point(nxt.x, nxt.y));
				
				nxt.y += connects.sack2.get(i);
				sweep1.add(new Point(nxt.x, nxt.y));
			}
			
			for(int i = upRight.sack1.size()-1; i >= 0; i--) {
				Point prev = sweep1.get(sweep1.size()-1);
				Point nxt = new Point(prev.x, prev.y);
				
				nxt.x -= upRight.sack2.get(i);
				sweep1.add(new Point(nxt.x, nxt.y));
				
				nxt.y -= upRight.sack1.get(i);
				sweep1.add(new Point(nxt.x, nxt.y));
			}
			
			sweep1.remove(sweep1.size()-1);
			out.println("Yes");
			for(Point p : sweep1) {
				out.println(p);
//				System.err.printf("(%d, %d)\n", p.x, p.y);
			}
			
		}
		
		out.close();
	}
	
	
	void swap(ArrayList<Integer> x1, ArrayList<Integer> x2) {
		ArrayList<Integer> tmp = x1;
		x1 = x2;
		x2 = tmp;
	}

	Pair knapsack(int[] a) {
		int n = a.length;
		int sum = 0;
		for(int i : a) sum += i;
		if(sum % 2 == 1) return null;
		
		BitSet[] dp = new BitSet[n + 1];
		dp[0] = new BitSet(sum + 10);
		dp[0].set(0);
		
		for(int i = 1; i <= n; i++) {
			int val = a[i-1];
			dp[i] = new BitSet(dp[i-1]);
			dp[i].shift(val);
			dp[i].or(dp[i-1]);
		}

		if(!dp[n].isSet(sum/2)) return null;
		ArrayList<Integer> p1 = new ArrayList<>();
		ArrayList<Integer> p2 = new ArrayList<>();
		int curSum = sum/2;
		
		for(int i = n; i >= 1; i--) {
			int val = a[i-1];
			if(dp[i-1].isSet(curSum)) {
				p2.add(val);
			}
			else {
				p1.add(val);
				curSum -= val;
			}
		}
		
		return new Pair(p1, p2);
	}
	
	class Point {
		int x, y;
		Point(int a, int b) {
			x = a; y = b;
		}
		public String toString() {
			return String.format("%d %d", x, y);
		}
	}
	
	class Pair {
		ArrayList<Integer> sack1, sack2;
		Pair(ArrayList<Integer> s1, ArrayList<Integer> s2) {
			sack1 = s1;
			sack2 = s2;
		}
		Pair() {
			sack1 = new ArrayList<>();
			sack2 = new ArrayList<>();
		}
		public String toString() {
			return String.format("%s\n%s\n", sack1, sack2);
		}
	}
	
	class BitSet {
		int n, size, AMT = 60;
		long[] arr;
		BitSet(int a) {
			n = a;
			size = n/AMT + (n % AMT > 0 ? 1 : 0);
			arr = new long[size];
		}
		BitSet(BitSet b) {
			n = b.n; size = b.size;
			arr = b.arr.clone();
		}
		void set(int idx) {
			int block = idx/AMT;
			arr[block] |= 1L << (idx % AMT);
		}
		boolean isSet(int idx) {
			int block = idx/AMT;
			long it = (1L << (idx%AMT)) & arr[block];
			return it > 0;
		}
		void or(BitSet b) {
			for(int i = 0; i < arr.length; i++)
				arr[i] |= b.arr[i];
		}
		void shift(int amt) {
			int totalBlocks = amt/AMT;
			
			for(int i = size-1; i >= 0 && totalBlocks > 0; i--) {
				if(i+totalBlocks < size) {
					arr[i+totalBlocks] = arr[i];
				}
				arr[i] = 0;
			}
			
			int rem = amt % AMT;
			for(int i = size-1; i >= 0 && rem > 0; i--) {
				long first = (1L << (AMT-rem))-1;
				long newEnd = arr[i] & first;
				
				long second = ((1L << rem) - 1) << (AMT-rem);
				long oldStart = (arr[i] & second) >> (AMT-rem);
				
				arr[i] = newEnd << rem;
				if(i+1 < size) {
					arr[i+1] |= oldStart;
				}
			}
		}
		public String toString() {
			String it = "";
			for(int i = 0; i < size; i++) {
				String add = Long.toBinaryString(arr[i]);
				while(add.length() < AMT) add = "0"+add;
				it += add;
			}
			return it;
		}
	}
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, BS);
			}
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}