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 buffer_size = 1e5 + 5;
char buf[buffer_size], *S, *T;
bool flag_EOF;
inline char read_char() {
  if (S == T) T = (S = buf) + fread(buf, 1, buffer_size, stdin);
  return S != T ? *(S++) : EOF;
}
inline int read_int() {
  bool flag = false;
  char c = read_char();
  while (c < '0' || c > '9') {
    if (c == EOF) {
      flag_EOF = true;
      return 0;
    }
    flag = (c == '-' ? true : flag);
    c = read_char();
  }
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + (c ^ 48);
    c = read_char();
  }
  return flag ? -x : x;
}
const int max_cnt = 1e3 + 5;
int l[max_cnt], p[max_cnt];
bool mark[max_cnt];
vector<int> a[2], b[2];
const int max_size = 5e5 + 5;
bitset<max_size> f[2];
bool dp[max_size];
int val[max_size];
inline int cmp1(int x, int y) { return abs(x) < abs(y); }
inline int cmp2(int x, int y) { return abs(x) > abs(y); }
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int h, v;
    scanf("%d", &h);
    for (int i = 1; i <= h; ++i) scanf("%d", l + i);
    scanf("%d", &v);
    for (int i = 1; i <= v; ++i) scanf("%d", p + i);
    if (h != v) {
      printf("No\n");
      continue;
    }
    int sum1 = 0, sum2 = 0;
    for (int i = 1; i <= h; ++i) sum1 += l[i];
    for (int i = 1; i <= v; ++i) sum2 += p[i];
    if ((sum1 & 1) || (sum2 & 1)) {
      printf("No\n");
      continue;
    }
    random_shuffle(l + 1, l + h + 1);
    for (int i = 0; i <= sum1; ++i) f[0][i] = 0;
    f[0][0] = 1;
    int pos1 = -1;
    for (int i = 1; i <= h; ++i) {
      int x = (i & 1) ^ 1, y = i & 1;
      f[y] = f[x] | (f[x] << l[i]);
      if (f[y][sum1 >> 1]) {
        pos1 = i;
        break;
      }
    }
    if (pos1 == -1) {
      printf("No\n");
      continue;
    }
    random_shuffle(p + 1, p + v + 1);
    for (int i = 0; i <= sum2; ++i) f[0][i] = 0;
    f[0][0] = 1;
    int pos2 = -1;
    for (int i = 1; i <= v; ++i) {
      int x = (i & 1) ^ 1, y = i & 1;
      f[y] = f[x] | (f[x] << p[i]);
      if (f[y][sum2 >> 1]) {
        pos2 = i;
        break;
      }
    }
    if (pos2 == -1) {
      printf("No\n");
      continue;
    }
    a[0].clear(), a[1].clear();
    int tot1 = sum1 >> 1;
    for (int i = 1; i <= h; ++i) mark[i] = false;
    for (int i = pos1 + 1; i <= h; ++i) {
      a[0].push_back(l[i]);
      mark[i] = true;
      tot1 -= l[i];
    }
    for (int i = 0; i <= tot1; ++i) dp[i] = false;
    dp[0] = true;
    for (int i = 1; i <= pos1; ++i)
      for (int j = tot1 - l[i]; j >= 0; --j)
        if (dp[j] && !dp[j + l[i]]) {
          dp[j + l[i]] = true;
          val[j + l[i]] = i;
        }
    int now = tot1;
    while (now) {
      a[0].push_back(l[val[now]]);
      mark[val[now]] = true;
      now -= l[val[now]];
    }
    int cnt1 = 0;
    for (int i = 1; i <= h; ++i)
      if (!mark[i]) {
        a[1].push_back(l[i]);
        ++cnt1;
      }
    b[0].clear(), b[1].clear();
    int tot2 = sum2 >> 1;
    for (int i = 1; i <= v; ++i) mark[i] = false;
    for (int i = pos2 + 1; i <= v; ++i) {
      b[0].push_back(p[i]);
      mark[i] = true;
      tot2 -= p[i];
    }
    for (int i = 0; i <= tot2; ++i) dp[i] = false;
    dp[0] = true;
    for (int i = 1; i <= pos2; ++i)
      for (int j = tot2 - p[i]; j >= 0; --j)
        if (dp[j] && !dp[j + p[i]]) {
          dp[j + p[i]] = true;
          val[j + p[i]] = i;
        }
    now = tot2;
    while (now) {
      b[0].push_back(p[val[now]]);
      mark[val[now]] = true;
      now -= p[val[now]];
    }
    int cnt2 = 0;
    for (int i = 1; i <= v; ++i)
      if (!mark[i]) {
        b[1].push_back(p[i]);
        ++cnt2;
      }
    printf("Yes\n");
    int x = 0, y = 0;
    if (a[0].size() < a[1].size()) swap(a[0], a[1]);
    if (b[0].size() > b[1].size()) swap(b[0], b[1]);
    sort(a[1].begin(), a[1].end());
    sort(b[1].begin(), b[1].end(), greater<int>());
    while (a[1].size()) {
      x += a[1].back();
      printf("%d %d\n", x, y);
      y += b[1].back();
      printf("%d %d\n", x, y);
      a[1].pop_back();
      b[1].pop_back();
    }
    while (b[1].size()) {
      x -= a[0].back();
      printf("%d %d\n", x, y);
      y += b[1].back();
      printf("%d %d\n", x, y);
      a[0].pop_back();
      b[1].pop_back();
    }
    sort(a[0].begin(), a[0].end());
    sort(b[0].begin(), b[0].end(), greater<int>());
    while (b[0].size()) {
      x -= a[0].back();
      printf("%d %d\n", x, y);
      y -= b[0].back();
      printf("%d %d\n", x, y);
      a[0].pop_back();
      b[0].pop_back();
    }
  }
  return 0;
}