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.*;  
public class Main 
{
    PrintWriter out;
    FastReader sc;
    long[] m= {(long)(1e9+7),998244353};
    long mod=m[1];
    long maxlong=Long.MAX_VALUE;
    long minlong=Long.MIN_VALUE;
    /******************************************************************************************
     *****************************************************************************************/
	public void sol(){
		int b=ni(),w=ni();
		StringBuilder sb=new StringBuilder();
		if(b>=w) {
			int i=2,j=2;
			while(w>0) {
				sb.append(i+" "+j+"\n");
				sb.append(i+" "+(j+1)+"\n");
				j+=2;
				w--;b--;
			}int p=j;
			if(b>0) {
				sb.append(i+" 1\n");
				b--;
			}j=2;i=1;
			while(b>0&&j<p) {
				sb.append(i+" "+j+"\n");
				j+=2;
				b--;
			}i=3;j=2;
			while(b>0&&j<p) {
				sb.append(i+" "+j+"\n");
				j+=2;
				b--;
			}if(b>0) {
				no();
			}else {
				yes();
				pr(sb);
			}
		}else {
			int i=3,j=2;
			while(b>0) {
				sb.append(i+" "+j+"\n");
				sb.append(i+" "+(j+1)+"\n");
				j+=2;
				w--;b--;
			}int p=j;
			if(w>0) {
				sb.append(i+" 1\n");
				w--;
			}j=2;i=2;
			while(w>0&&j<p) {
				sb.append(i+" "+j+"\n");
				j+=2;
				w--;
			}i=4;j=2;
			while(w>0&&j<p) {
				sb.append(i+" "+j+"\n");
				j+=2;
				w--;
			}if(w>0) {
				no();
			}else {
				yes();
				pr(sb);
			}
		}
	}
    public static void main(String[] args) 
	{ 
	    Main g=new Main();
		g.out=new PrintWriter(System.out);
		g.sc=new FastReader();
		int t=1;
 		t=g.ni();
		while(t-->0)
		g.sol();
		g.out.flush();
	}
	
	/****************************************************************************************
     *****************************************************************************************/
	static class FastReader 
	{ 
		BufferedReader br; 
		StringTokenizer st; 
 
		public FastReader() 
		{ 
			br = new BufferedReader(new
					InputStreamReader(System.in)); 
		} 
 
		String next() 
		{ 
			while (st == null || !st.hasMoreElements()) 
			{ 
				try
				{ 
					st = new StringTokenizer(br.readLine()); 
				} 
				catch (IOException e) 
				{ 
					e.printStackTrace(); 
				} 
			} 
			return st.nextToken(); 
		} 
 
		int nextInt() 
		{ 
			return Integer.parseInt(next()); 
		} 
 
		long nextLong() 
		{ 
			return Long.parseLong(next()); 
		} 
 
		double nextDouble() 
		{ 
			return Double.parseDouble(next()); 
		} 
 
		String nextLine() 
		{ 
			String str = ""; 
			try
			{ 
				str = br.readLine(); 
			} 
			catch (IOException e) 
			{ 
				e.printStackTrace(); 
			} 
			return str; 
		} 
	} public int ni(){
	      return sc.nextInt();
	}public long nl(){
	      return sc.nextLong();
	}public double nd(){
	      return sc.nextDouble();
	}public char[] rl(){
	      return sc.nextLine().toCharArray();
	}public String rl1(){
	      return sc.nextLine();
	}
	public void pl(Object s){
	      out.println(s);
	}public void ex(){
	      out.println();
	}
	public void pr(Object s){
	      out.print(s);
	}public String next(){
	      return sc.next();
	}public long abs(long x){
	      return Math.abs(x);
	}
	public int abs(int x){
	      return Math.abs(x);
	}
	public double abs(double x){
	      return Math.abs(x);
	}public long min(long x,long y){
            return (long)Math.min(x,y);
      }
      public int min(int x,int y){
            return (int)Math.min(x,y);
      }
      public double min(double x,double y){
            return Math.min(x,y);
      }public long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}public long lcm(long a, long b) {
            return (a / gcd(a, b)) * b;
      }
       void sort1(int[] a) {
		ArrayList<Integer> l = new ArrayList<>();
		for (int i : a) {
			l.add(i);
		}
		Collections.sort(l,Collections.reverseOrder());
		for (int i = 0; i < a.length; i++) {
			a[i] = l.get(i);
		}
	}
	 void sort(int[] a) {
		ArrayList<Integer> l = new ArrayList<>();
		for (int i : a) {
			l.add(i);
		}
		Collections.sort(l);
		for (int i = 0; i < a.length; i++) {
			a[i] = l.get(i);
		}
	}void sort(long[] a) {
		ArrayList<Long> l = new ArrayList<>();
		for (long i : a) {
			l.add(i);
		}
		Collections.sort(l);
		for (int i = 0; i < a.length; i++) {
			a[i] = l.get(i);
		}
	}void sort1(long[] a) {
		ArrayList<Long> l = new ArrayList<>();
		for (long i : a) {
			l.add(i);
		}
		Collections.sort(l,Collections.reverseOrder());
		for (int i = 0; i < a.length; i++) {
			a[i] = l.get(i);
		}
	}
	void sort(double[] a) {
		ArrayList<Double> l = new ArrayList<>();
		for (double i : a) {
			l.add(i);
		}
		Collections.sort(l);
		for (int i = 0; i < a.length; i++) {
			a[i] = l.get(i);
		}
	}long pow(long a,long b){
          if(b==0){
                return 1;
          }long p=pow(a,b/2);
          if(b%2==0) return (p*p)%mod;
          else return (((p*p)%mod)*a)%mod;
    }
	
	int  swap(int a,int b){
	      return a;
	}long  swap(long a,long b){
	      return a;
	}double  swap(double a,double b){
	      return a;
	}
	boolean isPowerOfTwo (int x) 
      { 
            return x!=0 && ((x&(x-1)) == 0);     
      }boolean isPowerOfTwo (long x) 
      { 
            return x!=0 && ((x&(x-1)) == 0);     
      }public long max(long x,long y){
            return (long)Math.max(x,y);
      }
      public int max(int x,int y){
            return (int)Math.max(x,y);
      }
      public double max(double x,double y){
            return Math.max(x,y);
      }long sqrt(long x){
            return (long)Math.sqrt(x);
      }int sqrt(int x){
            return (int)Math.sqrt(x);
      }void input(int[] ar,int n){
            for(int i=0;i<n;i++)ar[i]=ni();
      }void input(long[] ar,int n){
            for(int i=0;i<n;i++)ar[i]=nl();
      }void fill(int[] ar,int k){
            Arrays.fill(ar,k);
      }void yes(){
            pl("YES");
      }void no(){
            pl("NO");
      }
    long[] sieve(int n) 
    {
          long[] k=new long[n+1];
          boolean[] pr=new boolean[n+1];
          for(int i=1;i<=n;i++){
                k[i]=i;
                pr[i]=true;
          }for(int i=2;i<=n;i++){
                if(pr[i]){
                      for(int j=i+i;j<=n;j+=i){
                            pr[j]=false;
                            if(k[j]==j){
                                  k[j]=i;
                            }
                      }
                }
          }return k;
    }
    int strSmall(int[] arr, int target)  
    {  
        int start = 0, end = arr.length-1;  
        int ans = -1;  
        while (start <= end) {  
            int mid = (start + end) / 2;   
            if (arr[mid] >= target) {  
                end = mid - 1;  
            }   
            else {  
                ans = mid;  
                start = mid + 1;  
            }  
        }  
        return ans;  
    } int strSmall(ArrayList<Integer> arr, int target)  
    {  
        int start = 0, end = arr.size()-1;  
        int ans = -1;  
        while (start <= end) {  
            int mid = (start + end) / 2;   
            if (arr.get(mid) > target) {  
                start = mid + 1; 
                ans=start;
            }   
            else {
                end = mid - 1;  
            }  
        }  
        return ans;  
    }long mMultiplication(long a,long b) 
    { 
        long res = 0;    
        a %= mod; 
  
        while (b > 0)  
        {  
            if ((b & 1) > 0)  
            { 
                res = (res + a) % mod; 
            }  
            a = (2 * a) % mod; 
  
            b >>= 1;  
        } 
        return res; 
    }long nCr(int n, int r ,int p)
    {
 
          if (n<r) 
              return 0;
        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] * modInverse(fac[r], p)
                % p * modInverse(fac[n - r], p)
                % p)
            % p;
    }long power(long x, long y, long p)
    {
        long res = 1;
        x = x % p;
 
        while (y > 0) {
            if (y % 2 == 1)
                res = (res * x) % p;
            y = y >> 1; 
            x = (x * x) % p;
        }
 
        return res;
    }long modInverse(long n, long p)
    {
        return power(n, p - 2, p);
    }
    
    int[][] floydWarshall(int graph[][],int INF,int V)
    {
        int dist[][] = new int[V][V];
        int i, j, k;
        for (i = 0; i < V; i++)
            for (j = 0; j < V; j++)
                dist[i][j] = graph[i][j];
        for (k = 0; k < V; k++)
        {
            for (i = 0; i < V; i++)
            {
                for (j = 0; j < V; j++)
                {
                    if (dist[i][k] + dist[k][j] < dist[i][j])
                        dist[i][j] = dist[i][k] + dist[k][j];
                }
            }
        }return dist;
    }
    class minque {
		Deque<Long> q;
		minque(){
			q=new ArrayDeque<Long>();
		}public void add(long p){
			while(!q.isEmpty()&&q.peekLast()>p)q.pollLast();
			q.addLast(p);
		}public void remove(long p) {
			if(!q.isEmpty()&&q.getFirst()==p)q.removeFirst();
		}public long min() {
			return q.getFirst();
		}
	}
      public static class Pair implements Comparable<Pair> {
		long x;
		long y;
 
		public Pair(long x, long y) {
			this.x = x;
			this.y = y;
		}
		public int compareTo(Pair other) {
			if (this.x == other.x) {
				return Long.compare(this.y, other.y);
			}
			return Long.compare(this.x, other.x);
		}
      }
	 
}