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
import java.util.*;
import java.io.*;
import static java.lang.Math.*;


public class cf2 implements Runnable {   
	
	long gcd(long a, long b) 
	{ 
	    if (a == 0) 
	        return b; 
	    return gcd(b % a, a); 
	} 

   long power(long x, long y, long p)
    {
       
        long res = 1;     
   
        x=x % p; 
     
        while (y > 0)
        {
            
            if((y & 1)==1)
                res = ((res%p) * (x%p))% p;
     
            y =y >> 1; 
            x =((x%p)*(x%p))%p; 
        }
        return res;
    }
	
  
   class pa
   {
	   int x;
	   int y;
	   
	   public pa(int a,int b)
	   {
		   x=a;
		   y=b;
	   }
   }
    
	public void run() {
		
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		
		int q=in.nextInt();
		while(q-->0)
		{
			int swx=2,swy=2;
			int sbx=2,sby=3;
			
			int b=in.nextInt();
			int wh=in.nextInt();
			
			int bb=b;
			int ww=wh;
			ArrayList<pa> ans=new ArrayList<>();
			
			if(wh<=b)
			{
				int ewx=-1,ewy=-1;
				
				int xx=swx;
				int yy=swy;
				
				while(wh>0)
				{	
					ans.add(new pa(xx,yy));
					wh--;
					ewx=xx;
					ewy=yy;
					ans.add(new pa(++xx,yy));
					b--;
					
					xx++;
					
					
				}
				
				
				
				while(b>0 && ewx>=1)
				{
					ans.add(new pa(ewx,ewy+1));
					b--;
					
					if(b==0)
						break;
					
					ans.add(new pa(ewx,ewy-1));
					b--;
					
					ewx-=2;
				}
				
				if(b>0 && ans.size()<bb+ww)
					ans.add(new pa(swx-1,swy));
				
				if(ans.size()==bb+ww)
				{
					w.println("YES");
					
					for(pa p:ans)
						w.println(p.x+" "+p.y);
				
				}
				else
					w.println("NO");
			}
			else
			{
				int ebx=-1,eby=-1;
				
				int xx=sbx;
				int yy=sby;
				
				while(b>0)
				{	
					ans.add(new pa(xx,yy));
					b--;
					ebx=xx;
					eby=yy;
					ans.add(new pa(++xx,yy));
					wh--;
					
					xx++;
					
					
				}
				
				//w.println(ebx+" "+eby);
				
				while(wh>0 && ebx>=1)
				{
					ans.add(new pa(ebx,eby+1));
					wh--;
					
					if(wh==0)
						break;
					
					ans.add(new pa(ebx,eby-1));
					wh--;
					
					ebx-=2;
				}
				
				if(wh>0 && ans.size()<bb+ww)
					ans.add(new pa(sbx-1,sby));
				
				if(ans.size()==bb+ww)
				{
					w.println("YES");
					
					for(pa p:ans)
						w.println(p.x+" "+p.y);
				
				}
				else
					w.println("NO");
			}
		}
		
		w.close();
	}
	
	static class InputReader {
		
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
		
		public int read() {
			
			if (numChars==-1) 
				throw new InputMismatchException();
			
			if (curChar >= numChars) {
				
				curChar = 0;
				
				try {
					numChars = stream.read(buf);
				}
				catch (IOException e) {
					throw new InputMismatchException();
				}
				
				if(numChars <= 0)				
					return -1;
			}
			
			return buf[curChar++];
		}
		 
		public String nextLine() {
			
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
	        
			try {
	            str = br.readLine();
	        }
	        catch (IOException e) {
	            e.printStackTrace();
	        }
			
	        return str;
		}
		
		public int nextInt() {
		
			int c = read();
			
			while(isSpaceChar(c)) 
				c = read();
			
			int sgn = 1;
			
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			
			int res = 0;
			
			do {
				if(c<'0'||c>'9') 
					throw new InputMismatchException();
				
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c)); 
			
			return res * sgn;
		}
		
		public long nextLong() {
			
			int c = read();
			
			while (isSpaceChar(c))
				c = read();
			
			int sgn = 1;
			
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			
			long res = 0;
			
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				
				res *= 10;
				res += c - '0';
				c = read();
			}
			
			while (!isSpaceChar(c));
				return res * sgn;
		}
		
		public double nextDouble() {
			
			int c = read();
			
			while (isSpaceChar(c))
				c = read();
			
			int sgn = 1;
			
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			
			double res = 0;
			
			while (!isSpaceChar(c) && c != '.') {
				
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				
				res *= 10;
				res += c - '0';
				c = read();
			}
			
			if (c == '.') {
				
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) 
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			
			return res * sgn;
		}
		
		public String readString() {
			
			int c = read();
			
			while (isSpaceChar(c))
				c = read();
			
			StringBuilder res = new StringBuilder();
			
			do {
				res.appendCodePoint(c);
				c = read();
			} 
			while (!isSpaceChar(c));
			
			return res.toString();
		}
	 
		public boolean isSpaceChar(int c) {
			
			if (filter != null)
				return filter.isSpaceChar(c);
			
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	 
		public String next() {
			return readString();
		}
		
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	
	}

	public static void main(String args[]) throws Exception {
		new Thread(null, new cf2(),"cf2",1<<26).start();
	}
}   