Problem: You are given two integers b and w. You have a chessboard of size 10^9 × 10^9 with the top left cell at (1; 1), the cell (1; 1) is painted white.

Your task is to find a connected component on this chessboard that contains exactly b black cells and exactly w white cells. Two cells are called connected if they share a side (i.e. for the cell (x, y) there are at most four connected cells: (x - 1, y), (x + 1, y), (x, y - 1), (x, y + 1)). A set of cells is called a connected component if for every pair of cells C_1 and C_2 from this set, there exists a sequence of cells c_1, c_2, ..., c_k such that c_1 = C_1, c_k = C_2, all c_i from 1 to k are belong to this set of cells and for every i ∈ [1, k - 1], cells c_i and c_{i + 1} are connected.

Obviously, it can be impossible to find such component. In this case print "NO". Otherwise, print "YES" and any suitable connected component.

You have to answer q independent queries.

Input

The first line of the input contains one integer q (1 ≤ q ≤ 10^5) — the number of queries. Then q queries follow.

The only line of the query contains two integers b and w (1 ≤ b, w ≤ 10^5) — the number of black cells required and the number of white cells required.

It is guaranteed that the sum of numbers of cells does not exceed 2 ⋅ 10^5 (∑ w + ∑ b ≤ 2 ⋅ 10^5).

Output

For each query, print the answer to it.

If it is impossible to find the required component, print "NO" on the first line.

Otherwise, print "YES" on the first line. In the next b + w lines print coordinates of cells of your component in any order. There should be exactly b black cells and w white cells in your answer. The printed component should be connected.

If there are several answers, you can print any. All coordinates in the answer should be in the range [1; 10^9].

Example

Input


3
1 1
1 4
2 5


Output


YES
2 2
1 2
YES
2 3
1 3
3 3
2 2
2 4
YES
2 3
2 4
2 5
1 3
1 5
3 3
3 5

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
void print(long double out) {
  cout << fixed << setprecision(12) << out << '\n';
}
template <typename T>
void print(T out) {
  cout << out << '\n';
}
template <typename T1, typename T2>
void print(pair<T1, T2> out) {
  cout << out.first << ' ' << out.second << '\n';
}
template <typename T>
void print(vector<T> A) {
  for (long long i = (0); i < (A.size()); i++) {
    cout << A[i];
    cout << (i == A.size() - 1 ? '\n' : ' ');
  }
}
template <typename T>
void print(set<T> S) {
  vector<T> A(S.begin(), S.end());
  print(A);
}
template <typename T>
inline bool chmax(T &x, T y) {
  return (y > x) ? x = y, true : false;
}
template <typename T>
inline bool chmin(T &x, T y) {
  return (y < x) ? x = y, true : false;
}
long long sum(vector<long long> A) {
  long long res = 0;
  for (long long a : A) res += a;
  return res;
}
long long max(vector<long long> A) {
  long long res = -INF;
  for (long long a : A) chmax(res, a);
  return res;
}
long long min(vector<long long> A) {
  long long res = INF;
  for (long long a : A) chmin(res, a);
  return res;
}
long long toint(string s) {
  long long res = 0;
  for (char c : s) {
    res *= 10;
    res += (c - '0');
  }
  return res;
}
int toint(char c) { return c - '0'; }
inline long long pow(int x, long long n) {
  long long res = 1;
  for (long long _ = (0); _ < (n); _++) res *= x;
  return res;
}
inline long long pow(long long x, long long n, int mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) {
      res = (res * x) % mod;
    }
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
inline long long floor(long long a, long long b) {
  if (a < 0) {
    return (a - b + 1) / b;
  } else {
    return a / b;
  }
}
inline long long ceil(long long a, long long b) {
  if (a >= 0) {
    return (a + b - 1) / b;
  } else {
    return a / b;
  }
}
int popcount(long long S) { return __builtin_popcountll(S); }
long long B, W, Q;
const long long MAX = 1000000000;
vector<pair<long long, long long>> directions = {
    make_pair(1, 0), make_pair(-1, 0), make_pair(0, 1), make_pair(0, -1)};
void rec(pair<long long, long long> cur, long long &bcnt, long long &wcnt,
         unordered_map<long long, unordered_map<long long, bool>> &visited,
         vector<pair<long long, long long>> &res) {
  for (pair<long long, long long> nxt : directions) {
    long long h = nxt.first + cur.first;
    long long w = nxt.second + cur.second;
    bool is_blk = (h + w) % 2;
    if (h <= 0 || h > MAX || w <= 0 || w > MAX) continue;
    if (is_blk && bcnt == 0 || !is_blk && wcnt == 0) continue;
    if (visited[h][w]) continue;
    visited[h][w] = 1;
    if (is_blk) {
      bcnt--;
    } else {
      wcnt--;
    }
    res.push_back(make_pair(h, w));
    rec(make_pair(h, w), bcnt, wcnt, visited, res);
  }
}
vector<pair<long long, long long>> dfs(pair<long long, long long> src,
                                       long long bcnt, long long wcnt) {
  long long h = src.first, w = src.second;
  vector<pair<long long, long long>> res;
  unordered_map<long long, unordered_map<long long, bool>> visited;
  visited[h][w] = 1;
  res.push_back(make_pair(h, w));
  rec(src, bcnt, wcnt, visited, res);
  return res;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> Q;
  for (long long _ = (0); _ < (Q); _++) {
    cin >> B >> W;
    vector<pair<long long, long long>> res;
    if (B >= W) {
      res = dfs(make_pair(MAX / 2 + 1, MAX / 2), B - 1, W);
    } else {
      res = dfs(make_pair(MAX / 2, MAX / 2), B, W - 1);
    }
    if (res.size() < B + W) {
      print("NO");
    } else {
      print("YES");
      for (auto a : res) {
        print(a);
      }
    }
  }
  return 0;
}