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;
static struct FastInput {
  static constexpr int BUF_SIZE = 1 << 20;
  char buf[BUF_SIZE];
  size_t chars_read = 0;
  size_t buf_pos = 0;
  FILE* in = stdin;
  char cur = 0;
  inline char get_char() {
    if (buf_pos >= chars_read) {
      chars_read = fread(buf, 1, BUF_SIZE, in);
      buf_pos = 0;
      buf[0] = (chars_read == 0 ? -1 : buf[0]);
    }
    return cur = buf[buf_pos++];
  }
  inline void tie(int) {}
  inline explicit operator bool() { return cur != -1; }
  inline static bool is_blank(char c) { return c <= ' '; }
  inline bool skip_blanks() {
    while (is_blank(cur) && cur != -1) {
      get_char();
    }
    return cur != -1;
  }
  inline FastInput& operator>>(char& c) {
    skip_blanks();
    c = cur;
    return *this;
  }
  inline FastInput& operator>>(string& s) {
    if (skip_blanks()) {
      s.clear();
      do {
        s += cur;
      } while (!is_blank(get_char()));
    }
    return *this;
  }
  template <typename T>
  inline FastInput& read_integer(T& n) {
    n = 0;
    if (skip_blanks()) {
      int sign = +1;
      if (cur == '-') {
        sign = -1;
        get_char();
      }
      do {
        n += n + (n << 3) + cur - '0';
      } while (!is_blank(get_char()));
      n *= sign;
    }
    return *this;
  }
  template <typename T>
  inline typename enable_if<is_integral<T>::value, FastInput&>::type operator>>(
      T& n) {
    return read_integer(n);
  }
  inline FastInput& operator>>(__int128& n) { return read_integer(n); }
  template <typename T>
  inline typename enable_if<is_floating_point<T>::value, FastInput&>::type
  operator>>(T& n) {
    n = 0;
    if (skip_blanks()) {
      string s;
      (*this) >> s;
      sscanf(s.c_str(), "%lf", &n);
    }
    return *this;
  }
} fast_input;
static struct FastOutput {
  static constexpr int BUF_SIZE = 1 << 20;
  char buf[BUF_SIZE];
  size_t buf_pos = 0;
  static constexpr int TMP_SIZE = 1 << 20;
  char tmp[TMP_SIZE];
  FILE* out = stdout;
  inline void put_char(char c) {
    buf[buf_pos++] = c;
    if (buf_pos == BUF_SIZE) {
      fwrite(buf, 1, buf_pos, out);
      buf_pos = 0;
    }
  }
  ~FastOutput() { fwrite(buf, 1, buf_pos, out); }
  inline FastOutput& operator<<(char c) {
    put_char(c);
    return *this;
  }
  inline FastOutput& operator<<(const char* s) {
    while (*s) {
      put_char(*s++);
    }
    return *this;
  }
  inline FastOutput& operator<<(const string& s) {
    for (int i = 0; i < (int)s.size(); i++) {
      put_char(s[i]);
    }
    return *this;
  }
  template <typename T>
  inline char* integer_to_string(T n) {
    char* p = tmp + TMP_SIZE - 1;
    if (n == 0) {
      *--p = '0';
    } else {
      bool is_negative = false;
      if (n < 0) {
        is_negative = true;
        n = -n;
      }
      while (n > 0) {
        *--p = (char)('0' + n % 10);
        n /= 10;
      }
      if (is_negative) {
        *--p = '-';
      }
    }
    return p;
  }
  template <typename T>
  inline typename enable_if<is_integral<T>::value, char*>::type stringify(T n) {
    return integer_to_string(n);
  }
  inline char* stringify(__int128 n) { return integer_to_string(n); }
  template <typename T>
  inline typename enable_if<is_floating_point<T>::value, char*>::type stringify(
      T n) {
    sprintf(tmp, "%.17f", n);
    return tmp;
  }
  template <typename T>
  inline FastOutput& operator<<(const T& n) {
    auto p = stringify(n);
    for (; *p != 0; p++) {
      put_char(*p);
    }
    return *this;
  }
} fast_output;
const int M = 1000 * 1000 / 2 / 2 + 5;
const int _ = 1005;
bitset<M> dp[2][_];
vector<int> q[2][2];
int n[2], sum[2];
int a[2][_];
bool cmp(int u, int v) { return u > v; }
bool solve() {
  if (n[0] != n[1]) return false;
  for (long long h = (0); h <= (1); ++h) {
    sum[h] = 0;
    for (long long i = (1); i <= (n[h]); ++i) sum[h] += a[h][i];
    if (sum[h] & 1) return false;
    sum[h] >>= 1;
    for (long long i = (0); i <= (n[h]); ++i) dp[h][i].reset();
    dp[h][0][0] = 1;
    for (long long i = (1); i <= (n[h]); ++i)
      dp[h][i] = dp[h][i - 1] | dp[h][i - 1] << a[h][i];
    if (!dp[h][n[h]][sum[h]]) return false;
    q[h][0].clear();
    q[h][1].clear();
    int now = sum[h];
    for (long long i = (n[h]); i >= (1); --i) {
      if (dp[h][i][now] && !dp[h][i - 1][now]) {
        q[h][0].push_back(a[h][i]);
        now -= a[h][i];
      } else
        q[h][1].push_back(a[h][i]);
    }
    if (q[h][0].size() < q[h][1].size()) swap(q[h][0], q[h][1]);
  }
  fast_output << "Yes" << '\n';
  int sw = 0;
  if (q[0][0].size() > q[1][0].size()) {
    sw = 1;
    swap(q[0][0], q[1][0]);
    swap(q[0][1], q[1][1]);
  }
  sort((q[0][0]).begin(), (q[0][0]).end(), cmp);
  sort((q[0][1]).begin(), (q[0][1]).end(), cmp);
  sort((q[1][0]).begin(), (q[1][0]).end(), cmp);
  sort((q[1][1]).begin(), (q[1][1]).end());
  pair<int, int> now = make_pair(0, 0);
  for (long long i = (0); i <= ((int)q[0][0].size() - 1); ++i) {
    now.first -= q[0][0][i];
    if (!sw)
      fast_output << now.first << ' ' << now.second << '\n';
    else
      fast_output << now.second << ' ' << now.first << '\n';
    now.second += q[1][0][i];
    if (!sw)
      fast_output << now.first << ' ' << now.second << '\n';
    else
      fast_output << now.second << ' ' << now.first << '\n';
  }
  for (long long i = ((int)q[0][0].size()); i <= ((int)q[1][0].size() - 1);
       ++i) {
    now.first += q[0][1][i - (int)q[0][0].size()];
    if (!sw)
      fast_output << now.first << ' ' << now.second << '\n';
    else
      fast_output << now.second << ' ' << now.first << '\n';
    now.second += q[1][0][i];
    if (!sw)
      fast_output << now.first << ' ' << now.second << '\n';
    else
      fast_output << now.second << ' ' << now.first << '\n';
  }
  for (long long i = ((int)q[1][0].size());
       i <= ((int)q[0][0].size() + (int)q[0][1].size() - 1); ++i) {
    now.first += q[0][1][i - (int)q[0][0].size()];
    if (!sw)
      fast_output << now.first << ' ' << now.second << '\n';
    else
      fast_output << now.second << ' ' << now.first << '\n';
    now.second -= q[1][1][i - (int)q[1][0].size()];
    if (!sw)
      fast_output << now.first << ' ' << now.second << '\n';
    else
      fast_output << now.second << ' ' << now.first << '\n';
  }
  return true;
}
signed main() {
  ios::sync_with_stdio(false);
  fast_input.tie(0);
  int start_time = clock();
  int T;
  fast_input >> T;
  while (T--) {
    for (long long h = (0); h <= (1); ++h) {
      fast_input >> n[h];
      for (long long i = (1); i <= (n[h]); ++i) fast_input >> a[h][i];
    }
    if (!solve()) fast_output << "No" << '\n';
  }
  return 0;
}