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>
#pragma comment(linker, "/STACK:2000000")
#pragma comment(linker, "/HEAP:2000000")
using namespace std;
void print_width(long long x) {
  std::cout << std::fixed;
  std::cout << std::setprecision(x);
}
long long power(long long x, long long y, long long p = 1000000007) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void printArr(long long a[], long long n) {
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << '\n';
}
void printVector(std::vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << '\n';
}
void printVectorPair(std::vector<pair<long long, long long>> v) {
  for (long long i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << '\n';
  ;
  cout << '\n';
}
long long Min(long long a, long long b, long long c) {
  if (a < b and a < c) return a;
  if (b < c) return b;
  return c;
}
void initialize(long long arr[], long long n) {
  for (long long i = 0; i <= n; i++) arr[i] = i;
}
long long root(long long arr[], long long i) {
  while (arr[i] != i) {
    arr[i] = arr[arr[i]];
    i = arr[i];
  }
  return i;
}
void Union(long long arr[], long long a, long long b) {
  long long root_a = root(arr, a);
  long long root_b = root(arr, b);
  arr[root_a] = root_b;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long power_wm(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long double dpower(long double x, long long y) {
  long double res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
std::vector<long long> vsum(std::vector<long long> a) {
  std::vector<long long> s(a.size());
  s[0] = a[0];
  for (long long i = 1; i <= a.size() - 1; i++) {
    s[i] = s[i - 1] + a[i];
  }
  return s;
}
std::vector<long double> vsumld(std::vector<long double> a) {
  std::vector<long double> s(a.size());
  s[0] = a[0];
  for (long long i = 1; i <= a.size() - 1; i++) {
    s[i] = s[i - 1] + a[i];
  }
  return s;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  long long x = a.second * b.first;
  long long y = a.first * b.second;
  if (x <= y)
    return false;
  else
    return true;
}
bool is_cap(char a) {
  if (a <= 'Z' and a >= 'A')
    return true;
  else
    return false;
}
bool is_small(char a) {
  if (a <= 'z' and a >= 'a')
    return true;
  else
    return false;
}
string addition(string str1, string str2) {
  string str = "";
  if (str1.size() > str2.size()) {
    swap(str1, str2);
  }
  int n1 = str1.size(), n2 = str2.size();
  reverse(str1.begin(), str1.end());
  reverse(str2.begin(), str2.end());
  int carry;
  carry = 0;
  for (int i = 0; i < n1; i++) {
    int sum;
    sum = ((str1[i] - '0') + (str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  for (int i = n1; i < n2; i++) {
    int sum;
    sum = ((str2[i] - '0') + carry);
    str.push_back(sum % 10 + '0');
    carry = sum / 10;
  }
  if (carry) str.push_back(carry + '0');
  reverse(str.begin(), str.end());
  return str;
}
bool mcomp(long long a, long long b, long long c, long long d) {
  if (a == b and b == c and c == d)
    return true;
  else
    return false;
}
long long modInverse(long long n, long long p) { return power(n, p - 2, p); }
long long nCr(long long n, long long r, long long p) {
  if (r == 0) return 1;
  long long fac[n + 1];
  fac[0] = 1;
  for (long long i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
long long c2(long long n) { return (n * (n - 1)) / 2; }
void time() {}
string multiply(string num1, string num2) {
  int n1 = num1.size();
  int n2 = num2.size();
  if (n1 == 0 || n2 == 0) return "0";
  vector<int> result(n1 + n2, 0);
  int i_n1 = 0;
  int i_n2 = 0;
  for (int i = n1 - 1; i >= 0; i--) {
    int carry = 0;
    int n1 = num1[i] - '0';
    i_n2 = 0;
    for (int j = n2 - 1; j >= 0; j--) {
      int n2 = num2[j] - '0';
      int sum = n1 * n2 + result[i_n1 + i_n2] + carry;
      carry = sum / 10;
      result[i_n1 + i_n2] = sum % 10;
      i_n2++;
    }
    if (carry > 0) result[i_n1 + i_n2] += carry;
    i_n1++;
  }
  int i = result.size() - 1;
  while (i >= 0 && result[i] == 0) i--;
  if (i == -1) return "0";
  string s = "";
  while (i >= 0) s += std::to_string(result[i--]);
  return s;
}
long long sti(string s) {
  long long ans = 0;
  long long p = 1;
  for (long long i = s.size() - 1; i >= 0; i--) {
    ans = (ans + ((long long)(s[i] - '0') * p) % 998244353) % 998244353;
    p = (p * 10) % 998244353;
  }
  return ans;
}
int lps(char *seq, int i, int j) {
  if (i == j) return 1;
  if (seq[i] == seq[j] && i + 1 == j) return 2;
  if (seq[i] == seq[j]) return lps(seq, i + 1, j - 1) + 2;
  return max(lps(seq, i, j - 1), lps(seq, i + 1, j));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long b, w;
    cin >> b >> w;
    swap(b, w);
    if (max(b, w) <= ((3 * min(b, w)) + 1)) {
    } else {
      cout << "NO" << '\n';
      ;
      continue;
    }
    cout << "YES" << '\n';
    ;
    if (b == w) {
      for (long long i = 0; i < b + w; i++) {
        cout << 1 << " " << i + 1 << '\n';
        ;
      }
    } else {
      if (b > w) {
        for (long long i = 0; i < ((2 * w) + 1); i++) {
          cout << 3 << " " << i + 1 << '\n';
          ;
        }
        long long rem = b - (w + 1);
        for (long long i = 2; i <= (2 * w); i += 2) {
          if (rem > 0) {
            cout << 2 << " " << i << '\n';
            ;
            rem--;
          }
          if (rem > 0) {
            cout << 4 << " " << i << '\n';
            ;
            rem--;
          }
        }
      } else {
        for (long long i = 0; i < ((2 * b) + 1); i++) {
          cout << 4 << " " << i + 1 << '\n';
          ;
        }
        long long rem = w - (b + 1);
        for (long long i = 2; i <= (2 * b); i += 2) {
          if (rem > 0) {
            cout << 3 << " " << i << '\n';
            ;
            rem--;
          }
          if (rem > 0) {
            cout << 5 << " " << i << '\n';
            ;
            rem--;
          }
        }
      }
    }
  }
  return 0;
}