#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int w, b;
    scanf("%d%d", &b, &w);
    int mx = max(w, b);
    int mn = min(w, b);
    vector<pair<int, int>> ans;
    int x = 2, y = 2;
    bool f = true;
    while (mx && mn) {
      if (f && abs(mx - mn) >= 3 && mx && mn) {
        ans.push_back(make_pair(x, y));
        ans.push_back(make_pair(x + 1, y));
        ans.push_back(make_pair(x - 1, y));
        ans.push_back(make_pair(x, y + 1));
        ans.push_back(make_pair(x, y - 1));
        y += 2;
        mx -= 4;
        mn -= 1;
        f = false;
        continue;
      }
      if (abs(mx - mn) == 2 && mx && mn) {
        ans.push_back(make_pair(x, y));
        ans.push_back(make_pair(x + 1, y));
        ans.push_back(make_pair(x, y + 1));
        ans.push_back(make_pair(x - 1, y));
        y += 2;
        mx -= 3;
        mn -= 1;
      }
      if (abs(mx - mn) == 1 && mx && mn) {
        ans.push_back(make_pair(x, y));
        ans.push_back(make_pair(x + 1, y));
        ans.push_back(make_pair(x, y + 1));
        y += 2;
        mx -= 2;
        mn -= 1;
      }
      if (abs(mx - mn) >= 3 && mx && mn) {
        ans.push_back(make_pair(x, y));
        ans.push_back(make_pair(x + 1, y));
        ans.push_back(make_pair(x, y + 1));
        ans.push_back(make_pair(x - 1, y));
        y += 2;
        mx -= 3;
        mn -= 1;
      }
      if (abs(mx - mn) == 0 && mx && mn) {
        ans.push_back(make_pair(x, y));
        ans.push_back(make_pair(x, y + 1));
        mx--;
        mn--;
        y += 2;
      }
    }
    if (mx != 0 || mn != 0)
      printf("NO\n");
    else {
      int c1 = 0, c2 = 0;
      for (auto x : ans) {
        if ((x.first + x.second) % 2 == 0)
          c1++;
        else
          c2++;
      }
      if (c1 != w) {
        assert(c2 == w);
        assert(c1 == b);
        for (auto &x : ans) {
          x.first++;
        }
      } else {
        assert(c1 == w);
        assert(c2 == b);
      }
      printf("YES\n");
      for (auto x : ans) printf("%d %d\n", x.first, x.second);
    }
  }
  return 0;
}
