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;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
int pct(int x) { return __builtin_popcount(x); }
int bits(int x) { return 31 - __builtin_clz(x); }
int cdiv(int a, int b) { return a / b + !(a < 0 || a % b == 0); }
int fstTrue(function<bool(int)> first, int lo, int hi) {
  hi++;
  assert(lo <= hi);
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    first(mid) ? hi = mid : lo = mid + 1;
  }
  return lo;
}
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const long long NINFLL = 0xc0c0c0c0c0c0c0c0;
const long long MOD = 1e9 + 7;
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1},
          dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
long long modInv(long long a) { return binpow(a, MOD - 2); }
bool sortcol(const vector<long long>& v1, const vector<long long>& v2) {
  return v1[1] < v2[1];
}
bool sortpair(const pair<int, int>& p1, const pair<int, int>& p2) {
  return p1.first < p2.first;
}
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<long long unsigned> distribution(0, 10);
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char* x) { cerr << '\"' << x << '\"'; }
void __print(const string& x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V>& x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T& x) {
  int first = 0;
  cerr << '{';
  for (auto& i : x) cerr << (first++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
const int mxN = 3e5 + 5;
int q = 1, n, m;
vector<int> a, b;
pair<vector<int>, vector<int>> partition(vector<int>& v) {
  int sum = accumulate(begin(v), end(v), 0);
  if (sum % 2) return {vector<int>(), vector<int>()};
  sum /= 2;
  vector<bitset<mxN>> pos(v.size() + 5);
  pos[0][0] = 1;
  for (int i = (0); i < (v.size()); i++) pos[i + 1] = pos[i] | pos[i] << v[i];
  if (!pos[v.size()][sum]) return {vector<int>(), vector<int>()};
  int idx = v.size();
  for (int i = (v.size()) - 1; i >= (0); i--) {
    if (sum >= v[i] && pos[i][sum - v[i]])
      sum -= v[i];
    else
      swap(v[i], v[--idx]);
  }
  return {vector<int>(v.begin(), v.begin() + idx),
          vector<int>(v.begin() + idx, v.end())};
}
void solve() {
  cin >> n;
  a.resize(n);
  for (int i = (0); i < (n); i++) cin >> a[i];
  cin >> m;
  b.resize(m);
  for (int i = (0); i < (m); i++) cin >> b[i];
  pair<vector<int>, vector<int>> h = partition(a), v = partition(b);
  if (n != m || (!h.first.size() && !h.second.size()) ||
      (!v.first.size() && !v.second.size()))
    cout << "No\n";
  else {
    cout << "Yes\n";
    vector<int> r = h.first, l = h.second, u = v.first, d = v.second;
    assert(l.size() + r.size() == d.size() + u.size());
    assert(accumulate(begin(l), end(l), 0) == accumulate(begin(r), end(r), 0) &&
           accumulate(begin(d), end(d), 0) == accumulate(begin(u), end(u), 0));
    if (r.size() > l.size()) swap(l, r);
    if (d.size() > u.size()) swap(d, u);
    sort(begin(r), end(r)), sort(begin(l), end(l)), sort(begin(u), end(u)),
        sort(begin(d), end(d));
    reverse(begin(r), end(r)), reverse(begin(d), end(d));
    pair<int, int> p;
    int cl = 0, cr = 0, cd = 0, cu = 0;
    for (int i = (0); i < (r.size()); i++) {
      p.first += r[i];
      cout << p.first << " " << p.second << "\n";
      p.second += u[i];
      cout << p.first << " " << p.second << "\n";
      cr++, cu++;
    }
    for (int i = (r.size()); i < (u.size()); i++) {
      p.first -= l[i - r.size() + d.size()];
      cout << p.first << " " << p.second << "\n";
      p.second += u[i];
      cout << p.first << " " << p.second << "\n";
      cu++, cl++;
    }
    for (int i = (d.size()) - 1; i >= (0); i--) {
      p.first -= l[i];
      cout << p.first << " " << p.second << "\n";
      p.second -= d[i];
      cout << p.first << " " << p.second << "\n";
      cl++, cd++;
    }
  }
  a.clear(), b.clear();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> q;
  while (q--) {
    solve();
  }
}