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;
int main() {
  srand(time(0));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int ncase;
  for (cin >> ncase; ncase--;) {
    int n;
    cin >> n;
    vector<int> H(n);
    for (int &x : H) {
      cin >> x;
    }
    int m;
    cin >> m;
    vector<int> V(m);
    for (int &x : V) {
      cin >> x;
    }
    if (n != m) {
      cout << "No\n";
      continue;
    }
    int h = accumulate(H.begin(), H.end(), 0);
    int v = accumulate(V.begin(), V.end(), 0);
    if ((h & 1) || (v & 1)) {
      cout << "No\n";
      continue;
    }
    bitset<500001> dH, dV;
    dH[0] = 1;
    for (int x : H) {
      dH |= dH << x;
    }
    if (!dH[h / 2]) {
      cout << "No\n";
      continue;
    }
    dV[0] = 1;
    for (int x : V) {
      dV |= dV << x;
    }
    if (!dV[v / 2]) {
      cout << "No\n";
      continue;
    }
    vector<int> idH(n), idV(m);
    iota(idH.begin(), idH.end(), 0);
    iota(idV.begin(), idV.end(), 0);
    vector<int> firstH, secondH;
    vector<int> firstV, secondV;
    while (true) {
      random_shuffle(idH.begin(), idH.end());
      const int N = 2000;
      vector<vector<bool>> dp(n + 1, vector<bool>(N + N + 1));
      vector<vector<int>> pred(n + 1, vector<int>(N + N + 1));
      dp[0][N] = 1;
      for (int i = 0; i < n; i++) {
        for (int j = 0; j <= N + N; j++)
          if (dp[i][j]) {
            int x = H[idH[i]];
            if (j + x <= N + N) {
              dp[i + 1][j + x] = 1;
              pred[i + 1][j + x] = 1;
            }
            if (j - x >= 0) {
              dp[i + 1][j - x] = 1;
              pred[i + 1][j - x] = -1;
            }
          }
      }
      if (dp[n][N]) {
        int cur = N;
        for (int i = n; i > 0; i--) {
          int x = pred[i][cur];
          int y = H[idH[i - 1]];
          if (x < 0) {
            secondH.push_back(idH[i - 1]);
            cur += y;
          } else {
            firstH.push_back(idH[i - 1]);
            cur -= y;
          }
        }
        break;
      }
    }
    while (true) {
      random_shuffle(idV.begin(), idV.end());
      const int N = 2000;
      vector<vector<bool>> dp(m + 1, vector<bool>(N + N + 1));
      vector<vector<int>> pred(m + 1, vector<int>(N + N + 1));
      dp[0][N] = 1;
      for (int i = 0; i < m; i++) {
        for (int j = 0; j <= N + N; j++)
          if (dp[i][j]) {
            int x = V[idV[i]];
            if (j + x <= N + N) {
              dp[i + 1][j + x] = 1;
              pred[i + 1][j + x] = 1;
            }
            if (j - x >= 0) {
              dp[i + 1][j - x] = 1;
              pred[i + 1][j - x] = -1;
            }
          }
      }
      if (dp[m][N]) {
        int cur = N;
        for (int i = m; i > 0; i--) {
          int x = pred[i][cur];
          int y = V[idV[i - 1]];
          if (x < 0) {
            secondV.push_back(idV[i - 1]);
            cur += y;
          } else {
            firstV.push_back(idV[i - 1]);
            cur -= y;
          }
        }
        break;
      }
    }
    auto solve = [&](const vector<int> &a, const vector<int> &b,
                     const vector<int> &c, const vector<int> &d) {
      int px = 0, py = 0;
      vector<pair<int, int>> ans;
      auto A = a, B = b, C = c, D = d;
      for (int i = 0; i < n; i++) {
        ans.emplace_back(px, py);
        if (!A.empty()) {
          int x = A.back();
          px += H[x];
          A.pop_back();
        } else {
          int x = C.back();
          px -= H[x];
          C.pop_back();
        }
        ans.emplace_back(px, py);
        if (!B.empty()) {
          int x = B.back();
          py += V[x];
          B.pop_back();
        } else {
          int x = D.back();
          py -= V[x];
          D.pop_back();
        }
      }
      return ans;
    };
    struct PT {
      int x, y;
      PT(int x = 0, int y = 0) : x(x), y(y){};
    };
    auto dis = [&](PT a, PT b) { return abs(a.x - b.x) + abs(a.y - b.y); };
    auto equal = [&](PT a, PT b) { return a.x == b.x && a.y == b.y; };
    auto onSeg = [&](PT a, PT b, PT c) {
      return dis(a, c) + dis(b, c) == dis(a, b) && !equal(a, c) && !equal(b, c);
    };
    auto okay = [&](const vector<pair<int, int>> &a) {
      int n = a.size();
      for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
          int sx1 = a[i].first, sy1 = a[i].second;
          int tx1 = a[(i + 1) % n].first, ty1 = a[(i + 1) % n].second;
          int sx2 = a[j].first, sy2 = a[j].second;
          int tx2 = a[(j + 1) % n].first, ty2 = a[(j + 1) % n].second;
          PT p1(sx1, sy1), p2(tx1, ty1), p3(sx2, sy2), p4(tx2, ty2);
          if (sx1 == tx1 && sy2 == ty2 || sy1 == ty1 && sx2 == tx2) {
            if (onSeg(p1, p2, p3) || onSeg(p1, p2, p4) || onSeg(p3, p4, p1) ||
                onSeg(p3, p4, p2)) {
              return false;
            }
            int lx = max(min(sx1, tx1), min(sx2, tx2));
            int rx = min(max(sx1, tx1), max(sx2, tx2));
            int ly = max(min(sy1, ty1), min(sy2, ty2));
            int ry = min(max(sy1, ty1), max(sy2, ty2));
            if (lx != rx || ly != ry) {
              continue;
            }
            PT p(lx, ly);
            if (onSeg(p1, p2, p) || onSeg(p3, p4, p)) {
              return false;
            }
          }
        }
      }
      return true;
    };
    sort(firstH.begin(), firstH.end(),
         [&](int x, int y) { return H[x] > H[y]; });
    sort(secondH.begin(), secondH.end(),
         [&](int x, int y) { return H[x] < H[y]; });
    sort(firstV.begin(), firstV.end(),
         [&](int x, int y) { return V[x] < V[y]; });
    sort(secondV.begin(), secondV.end(),
         [&](int x, int y) { return V[x] > V[y]; });
    while (true) {
      auto t1 = solve(firstH, firstV, secondH, secondV);
      auto t2 = solve(firstH, secondV, secondH, firstV);
      if (okay(t1)) {
        cout << "Yes\n";
        for (auto t : t1) {
          cout << t.first << ' ' << t.second << '\n';
        }
        break;
      } else if (okay(t2)) {
        cout << "Yes\n";
        for (auto t : t2) {
          cout << t.first << ' ' << t.second << '\n';
        }
        break;
      }
      random_shuffle(firstH.begin(), firstH.end());
      random_shuffle(firstV.begin(), firstV.end());
      random_shuffle(secondH.begin(), secondH.end());
      random_shuffle(secondV.begin(), secondV.end());
    }
  }
  return 0;
}