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>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001;
pair<vector<int>, vector<int> > solve(vector<int> L) {
  int N = (int)(L).size();
  int sum = 0;
  for (int i = 0; i < (N); i++) sum += L[i];
  if (sum % 2) {
    return {vector<int>(), vector<int>()};
  }
  sum /= 2;
  int lst[sum + 1];
  for (int i = 0; i < (sum + 1); i++) lst[i] = -1;
  lst[0] = 0;
  int sumSF = 0;
  for (int i = 0; i < (N); i++) {
    for (int j = (min(sum - L[i], sumSF) + 1) - 1; j >= 0; j--) {
      if (lst[j] != -1 && lst[j + L[i]] == -1) {
        lst[j + L[i]] = L[i];
      }
    }
    sumSF += L[i];
  }
  if (lst[sum] == -1) return {vector<int>(), vector<int>()};
  multiset<int> rem;
  for (auto& a : L) rem.insert(a);
  vector<int> fir;
  int cur = sum;
  while (cur > 0) {
    fir.push_back(lst[cur]);
    rem.erase(rem.find(lst[cur]));
    cur -= lst[cur];
  }
  vector<int> sec;
  for (auto& a : rem) sec.push_back(a);
  return {fir, sec};
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int H;
    cin >> H;
    vector<int> L(H);
    for (int i = 0; i < (H); i++) cin >> L[i];
    int V;
    cin >> V;
    vector<int> P(V);
    for (int i = 0; i < (V); i++) cin >> P[i];
    if (H != V) {
      cout << "No" << nl;
      continue;
    }
    pair<vector<int>, vector<int> > A = solve(L);
    pair<vector<int>, vector<int> > B = solve(P);
    if ((int)(A.first).size() == 0 || (int)(B.first).size() == 0) {
      cout << "No" << nl;
      continue;
    }
    if ((int)(A.first).size() > (int)(A.second).size()) {
      swap(A.first, A.second);
    }
    if ((int)(B.first).size() < (int)(B.second).size()) {
      swap(B.first, B.second);
    }
    sort(A.first.begin(), A.first.end());
    sort(A.second.begin(), A.second.end());
    reverse(A.first.begin(), A.first.end());
    reverse(A.second.begin(), A.second.end());
    sort(B.first.begin(), B.first.end());
    sort(B.second.begin(), B.second.end());
    vector<int> hor;
    for (int i = 0; i < ((int)(A.first).size()); i++) hor.push_back(A.first[i]);
    for (int i = 0; i < ((int)(A.second).size()); i++)
      hor.push_back(-A.second[i]);
    vector<int> ver;
    for (int i = 0; i < ((int)(B.first).size()); i++) ver.push_back(B.first[i]);
    for (int i = 0; i < ((int)(B.second).size()); i++)
      ver.push_back(-B.second[i]);
    int X = 0, Y = 0;
    cout << "Yes" << nl;
    for (int i = 0; i < (H + V); i++) {
      cout << X << " " << Y << nl;
      if (i % 2 == 0) {
        X += hor[i / 2];
      } else {
        Y += ver[i / 2];
      }
    }
  }
  return 0;
}