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

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 1002;
const int L_MAX = 1002;
int t;
int h, v;
int a[N_MAX], b[N_MAX];
map<int, int> dpa, dpb;
bool knapsack(int n, int v[], map<int, int> &dp) {
  dp[0] = 0;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    vector<int> aux;
    for (map<int, int>::iterator it = dp.begin(); it != dp.end(); it++)
      aux.push_back(it->first);
    for (int j : aux)
      if (dp.find(j + v[i]) == dp.end()) dp[j + v[i]] = v[i];
    sum += v[i];
  }
  if (sum & 1) return false;
  return (dp.find(sum / 2) != dp.end());
}
vector<int> aSmall, aBig, bSmall, bBig;
map<int, int> aux;
struct Segment {
  int a, b;
};
bool operator<(const Segment &s1, const Segment &s2) {
  return s1.b * s2.a < s2.b * s1.a;
}
vector<Segment> side1, side2, last;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> h;
    for (int i = 1; i <= h; i++) cin >> a[i];
    cin >> v;
    for (int i = 1; i <= v; i++) cin >> b[i];
    if (h != v) {
      cout << "No\n";
      continue;
    }
    dpa.clear();
    dpb.clear();
    if (knapsack(h, a, dpa) == false || knapsack(v, b, dpb) == false) {
      cout << "No\n";
      continue;
    }
    cout << "Yes\n";
    aSmall.clear();
    aBig.clear();
    bSmall.clear();
    bBig.clear();
    side1.clear();
    side2.clear();
    last.clear();
    int suma = 0, sumb = 0;
    for (int i = 1; i <= h; i++) suma += a[i];
    for (int i = 1; i <= v; i++) sumb += b[i];
    aux.clear();
    suma /= 2;
    while (suma > 0) {
      aSmall.push_back(dpa[suma]);
      suma -= aSmall.back();
      aux[aSmall.back()]++;
    }
    for (int i = 1; i <= h; i++)
      if (aux[a[i]] == 0)
        aBig.push_back(a[i]);
      else
        aux[a[i]]--;
    aux.clear();
    sumb /= 2;
    while (sumb > 0) {
      bSmall.push_back(dpb[sumb]);
      sumb -= bSmall.back();
      aux[bSmall.back()]++;
    }
    for (int i = 1; i <= v; i++)
      if (aux[b[i]] == 0)
        bBig.push_back(b[i]);
      else
        aux[b[i]]--;
    if ((int)aSmall.size() > (int)aBig.size()) swap(aSmall, aBig);
    if ((int)bSmall.size() > (int)bBig.size()) swap(bSmall, bBig);
    while (!aSmall.empty()) {
      side1.push_back(Segment{aSmall.back(), bBig.back()});
      aSmall.pop_back();
      bBig.pop_back();
    }
    while (!bBig.empty()) {
      last.push_back(Segment{aBig.back(), bBig.back()});
      aBig.pop_back();
      bBig.pop_back();
    }
    while (!bSmall.empty()) {
      side2.push_back(Segment{aBig.back(), bSmall.back()});
      aBig.pop_back();
      bSmall.pop_back();
    }
    sort(side1.begin(), side1.end());
    sort(side2.begin(), side2.end());
    int a = 0, b = 0;
    for (Segment s : side1) {
      a += s.a;
      cout << a << " " << b << "\n";
      b += s.b;
      cout << a << " " << b << "\n";
    }
    for (Segment s : last) {
      a -= s.a;
      cout << a << " " << b << "\n";
      b += s.b;
      cout << a << " " << b << "\n";
    }
    for (Segment s : side2) {
      a -= s.a;
      cout << a << " " << b << "\n";
      b -= s.b;
      cout << a << " " << b << "\n";
    }
  }
  return 0;
}