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 JAVA):

Solution:
import java.util.*;
import java.io.*;
import java.text.DecimalFormat;
 
 
public class Ay { 
 
 
        
 
	static class Reader 
    { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead; 
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[1000000]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public double nextDouble() throws IOException 
        { 
            double ret = 0, div = 1; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
  
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
  
            if (c == '.') 
            { 
                while ((c = read()) >= '0' && c <= '9') 
                { 
                    ret += (c - '0') / (div *= 10); 
                } 
            } 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        private void fillBuffer() throws IOException 
        { 
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
            if (bytesRead == -1) 
                buffer[0] = -1; 
        } 
  
        private byte read() throws IOException 
        { 
            if (bufferPointer == bytesRead) 
                fillBuffer(); 
            return buffer[bufferPointer++]; 
        } 
  
        public void close() throws IOException 
        { 
            if (din == null) 
                return; 
            din.close(); 
        } 
    } 
 
    static void oracle(int graph[][], int dist[][], int V) 
    { 
        int i, j, k; 
  
        for (i = 1; i < V; i++) 
            for (j = 1; j < V; j++) 
                dist[i][j] = graph[i][j]; 
  
        for (k = 1; k < V; k++) 
        { 
            for (i = 1; i < V; i++) 
            { 
                for (j = 1; j < V; j++) 
                { 
                    if (dist[i][k] + dist[k][j] < dist[i][j]) 
                        dist[i][j] = dist[i][k] + dist[k][j]; 
                } 
            } 
        } 
    } 
 
    static long fast_pow(long base,long n,long M)
    {
        if(n==0)
           return 1;
        if(n==1)
        return base;
        long halfn=fast_pow(base,n/2,M);
        if(n%2==0)
            return ( halfn * halfn ) % M;
        else
            return ( ( ( halfn * halfn ) % M ) * base ) % M;
    }
 
    static long finextDoubleMMI_fermat(long n,int M)
    {
        return fast_pow(n,M-2,M);
    }
 
    static long nCrModPFermat(int n, int r, int p) 
    { 
        if (r == 0) 
            return 1; 
        long[] fac = new long[n+1]; 
        fac[0] = 1;           
        for (int i = 1 ;i <= n; i++) 
            fac[i] = fac[i-1] * i % p;       
        return (fac[n]* finextDoubleMMI_fermat(fac[r], p)% p * finextDoubleMMI_fermat(fac[n-r], p) % p) % p; 
    } 
 
    static void merge(int arr[], int l, int m, int r) 
    { 
        int n1 = m - l + 1; 
        int n2 = r - m; 
  
        int L[] = new int [n1]; 
        int R[] = new int [n2]; 
  
        for (int i=0; i<n1; ++i) 
            L[i] = arr[l + i]; 
        for (int j=0; j<n2; ++j) 
            R[j] = arr[m + 1+ j]; 
        int i = 0, j = 0; 
        
        int k = l; 
        while (i < n1 && j < n2) 
        { 
            if (L[i] <= R[j]) 
            { 
                arr[k] = L[i]; 
                i++; 
            } 
            else
            { 
                arr[k] = R[j]; 
                j++; 
            } 
            k++; 
        } 
  
        while (i < n1) 
        { 
            arr[k] = L[i]; 
            i++; 
            k++; 
        } 
  
        while (j < n2) 
        { 
            arr[k] = R[j]; 
            j++; 
            k++; 
        } 
    } 
  
    static void sort(int arr[], int l, int r) 
    { 
        if (l < r) 
        { 
            int m = (l+r)/2; 
            sort(arr, l, m); 
            sort(arr , m+1, r); 
            merge(arr, l, m, r); 
        } 
    } 
 
    static void sort(int arr[]) 
    { 
        int l=0;
        int r=arr.length-1;
        if (l < r) 
        { 
            int m = (l+r)/2; 
            sort(arr, l, m); 
            sort(arr , m+1, r); 
            merge(arr, l, m, r); 
        } 
    } 
 
    static int[] arint(int n)throws IOException{
        int i;
        int a[]=new int[n];
        for(i=0;i<n;i++)
            a[i]=sc.nextInt();
        return a;
    }
 
 
    static long[] arlong(int n)throws IOException{
        int i;
        long a[]=new long[n];
        for(i=0;i<n;i++)
            a[i]=sc.nextLong();
        return a;
    }

    static Reader sc=new Reader(); 
    // static Scanner sc=new Scanner(System.in);
    static PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
 
    public static void main(String args[])throws IOException{
    	int i,j;
        int q=sc.nextInt();
        while(q-->0){
            int b=sc.nextInt();
            int w=sc.nextInt();
            if(b>=w){
                if(b>3*w+1){
                    pw.println("NO");
                }
                else{
                    pw.println("YES");
                    for(i=2;i<=2*w;i++){
                        pw.println("2 "+i);
                    }
                    b-=w-1;
                    // w=0;
                    if(b-->0){
                        pw.println("2 1");
                    }
                    if(b-->0){
                        pw.println("2 "+(2*w+1));
                    }
                    if(b>0){
                        for(i=2;i<=2*w;i+=2){
                            pw.println("1 "+i);
                            if(b--==1)
                                break;
                        }
                    }
                    if(b>0){
                        for(i=2;i<=2*w;i+=2){
                            pw.println("3 "+i);
                            if(b--==1)
                                break;
                        }
                    }
                }
            }
            else{
                if(w>3*b+1){
                    pw.println("NO");
                }
                else{
                    pw.println("YES");
                    for(i=3;i<=2*b+1;i++){
                        pw.println("2 "+i);
                    }
                    w-=b-1;
                    // b=0;
                    if(w-->0){
                        pw.println("2 2");
                    }
                    if(w-->0){
                        pw.println("2 "+(2*b+2));
                    }
                    if(w>0){
                        for(i=3;i<=2*b+1;i+=2){
                            pw.println("1 "+i);
                            if(w--==1)
                                break;
                        }
                    }
                    if(w>0){
                        for(i=3;i<=2*b+1;i+=2){
                            pw.println("3 "+i);
                            if(w--==1)
                                break;
                        }
                    }
                }
            }
        }
        pw.close();
        
    }
}