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>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
int dp[500011];
void sep(const vector<int> &v, vector<int> &a, vector<int> &b) {
  a.clear();
  b.clear();
  int sum = 0;
  for (__typeof((v).begin()) e = (v).begin(), e_end = (v).end(); e != e_end;
       ++e)
    sum += *e;
  if (sum % 2) return;
  memset(dp, -1, sizeof dp);
  dp[0] = 0;
  int high = 0;
  for (int i = 0, i_len = (v.size()); i < i_len; ++i) {
    for (int j = min(high, sum / 2 - v[i]); j >= 0; j--)
      if (dp[j] != -1 && dp[j + v[i]] == -1) {
        dp[j + v[i]] = v[i];
      }
    high += v[i];
  }
  if (dp[sum / 2] == -1) return;
  int cur = sum / 2;
  while (cur) {
    a.push_back(dp[cur]);
    cur -= dp[cur];
  }
  sort(a.begin(), a.end());
  int i = 0, j = 0;
  while (i < (int)v.size()) {
    if (j < (int)a.size() && v[i] == a[j]) {
      i++;
      j++;
    } else {
      b.push_back(v[i]);
      i++;
    }
  }
}
vector<int> HOR, VER;
vector<pair<int, int> > ans;
bool solve() {
  if (HOR.size() != VER.size()) return false;
  sort(HOR.begin(), HOR.end());
  sort(VER.begin(), VER.end());
  vector<int> h1, h2;
  sep(HOR, h1, h2);
  if (h1.empty()) return false;
  if (h1.size() > h2.size()) swap(h1, h2);
  vector<int> v1, v2;
  sep(VER, v1, v2);
  if (v1.empty()) return false;
  if (v1.size() < v2.size()) swap(v1, v2);
  ans.clear();
  int x = 0, y = 0;
  ans.emplace_back(0, 0);
  for (int i = 0, i_len = (HOR.size()); i < i_len; ++i) {
    int m;
    if (i < (int)h1.size()) {
      m = h1.rbegin()[i];
    } else {
      m = -h2.rbegin()[i - h1.size()];
    }
    x += m;
    ans.emplace_back(x, y);
    if (i < (int)v1.size()) {
      m = v1[i];
    } else {
      m = -v2[i - v1.size()];
    }
    y += m;
    ans.emplace_back(x, y);
  }
  assert(x == 0 && y == 0);
  return true;
}
void MAIN() {
  int H, V;
  scanf("%d", &H);
  HOR.resize(H);
  for (int i = 0, i_len = (H); i < i_len; ++i) scanf("%d", &HOR[i]);
  scanf("%d", &V);
  VER.resize(V);
  for (int i = 0, i_len = (V); i < i_len; ++i) scanf("%d", &VER[i]);
  if (solve()) {
    puts("Yes");
    for (int i = 0, i_len = (ans.size() - 1u); i < i_len; ++i) {
      printf("%d %d\n", ans[i].first, ans[i].second);
    }
  } else {
    puts("No");
  }
}
int main() {
  int TC = 1;
  scanf("%d", &TC);
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}