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>
void solve() {
  auto partition = [&](const std::vector<int> &a) {
    int n = a.size();
    std::vector<std::bitset<500001>> f(n + 1);
    f[0] = 1;
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      f[i + 1] = f[i] | f[i] << a[i];
      sum += a[i];
    }
    if (sum & 1 || !f[n][sum / 2]) {
      return std::make_pair(false, std::vector<int>());
    }
    std::vector<int> ans1, ans2;
    int now = sum / 2;
    for (int i = n - 1; i >= 0; --i) {
      if (!f[i][now]) {
        ans1.push_back(a[i]);
        now -= a[i];
      } else {
        ans2.push_back(-a[i]);
      }
    }
    std::sort(ans1.begin(), ans1.end());
    std::sort(ans2.begin(), ans2.end(), std::greater<int>());
    std::vector<int> ans;
    ans.insert(ans.end(), ans1.begin(), ans1.end());
    ans.insert(ans.end(), ans2.begin(), ans2.end());
    return std::make_pair(true, ans);
  };
  std::vector<int> s[2];
  bool flag = true;
  for (int k = 0; k < 2; ++k) {
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (int &v : a) {
      std::cin >> v;
    }
    auto tmp = partition(a);
    flag &= tmp.first;
    s[k].swap(tmp.second);
  }
  flag &= s[0].size() == s[1].size();
  if (!flag) {
    std::cout << "No\n";
    return;
  }
  std::reverse(s[0].begin(), s[0].end());
  for (int &x : s[0]) {
    x = -x;
  }
  auto get = [&](const std::vector<int> &a) {
    int p = 0;
    while (p < (int)a.size() && a[p] > 0) {
      ++p;
    }
    return p;
  };
  auto work = [&](std::vector<int> &a) {
    int p = 0;
    while (p < (int)a.size() && a[p] > 0) {
      ++p;
    }
    std::rotate(a.begin(), a.begin() + p, a.end());
    for (int &x : a) {
      x = -x;
    }
  };
  if (get(s[0]) > get(s[1])) {
    work(s[0]);
    work(s[1]);
  }
  std::cout << "Yes\n";
  int x = 0, y = 0;
  for (int i = 0; i < (int)s[0].size(); ++i) {
    x += s[0][i];
    std::cout << x << " " << y << "\n";
    y += s[1][i];
    std::cout << x << " " << y << "\n";
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  int T;
  std::cin >> T;
  while (T--) {
    solve();
  }
}