Alice and Bob play ping-pong with simplified rules.

During the game, the player serving the ball commences a play. The server strikes the ball then the receiver makes a return by hitting the ball back. Thereafter, the server and receiver must alternately make a return until one of them doesn't make a return.

The one who doesn't make a return loses this play. The winner of the play commences the next play. Alice starts the first play.

Alice has x stamina and Bob has y. To hit the ball (while serving or returning) each player spends 1 stamina, so if they don't have any stamina, they can't return the ball (and lose the play) or can't serve the ball (in this case, the other player serves the ball instead). If both players run out of stamina, the game is over.

Sometimes, it's strategically optimal not to return the ball, lose the current play, but save the stamina. On the contrary, when the server commences a play, they have to hit the ball, if they have some stamina left.

Both Alice and Bob play optimally and want to, firstly, maximize their number of wins and, secondly, minimize the number of wins of their opponent.

Calculate the resulting number of Alice's and Bob's wins.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of test cases.

The first and only line of each test case contains two integers x and y (1 ≤ x, y ≤ 10^6) — Alice's and Bob's initial stamina.

Output

For each test case, print two integers — the resulting number of Alice's and Bob's wins, if both of them play optimally.

Example

Input


3
1 1
2 1
1 7


Output


0 1
1 1
0 7

Note

In the first test case, Alice serves the ball and spends 1 stamina. Then Bob returns the ball and also spends 1 stamina. Alice can't return the ball since she has no stamina left and loses the play. Both of them ran out of stamina, so the game is over with 0 Alice's wins and 1 Bob's wins.

In the second test case, Alice serves the ball and spends 1 stamina. Bob decides not to return the ball — he loses the play but saves stamina. Alice, as the winner of the last play, serves the ball in the next play and spends 1 more stamina. This time, Bob returns the ball and spends 1 stamina. Alice doesn't have any stamina left, so she can't return the ball and loses the play. Both of them ran out of stamina, so the game is over with 1 Alice's and 1 Bob's win.

In the third test case, Alice serves the ball and spends 1 stamina. Bob returns the ball and spends 1 stamina. Alice ran out of stamina, so she can't return the ball and loses the play. Bob, as a winner, serves the ball in the next 6 plays. Each time Alice can't return the ball and loses each play. The game is over with 0 Alice's and 7 Bob's wins.
import java.util.*;

public class Tester {
    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        int t = input.nextInt();
        for(int testCase = 1; testCase <= t; testCase++){
            int x = input.nextInt();
            int y = input.nextInt();
            if(x == y){
                System.out.println(x - 1 + " " + y);
            }else if(x == y + 1){
                System.out.println(x - 1 + " " + y);
            }else if(x < y){
                System.out.println(x - 1 + " " + y);
            }else{
                System.out.println(x - 1 + " " + y);
            }
            
            /* 1455B:
            int x = input.nextInt();
            int c = 0;
            int k = 1;
            int numJumps = 0;
            while(c < x){
                c += k;
                k++;
                numJumps++;
            }
            System.out.print(x +"   "+numJumps + "   ");
            if(c - x - 1 < k + 1 && c - x - 1 > 0){
                //numJumps;
            }else{
                numJumps += c - x;
            }
            
            System.out.println(numJumps);*/
            
            /*1455A:
            String n = input.nextLine();
            System.out.println(n.length());
            */
            
            /*int n = input.nextInt();
            int[] mins = new int[n];
            ArrayList<Integer> repeats = new ArrayList<Integer>();
            for(int i = 0; i < n; i++){
                mins[i] = input.nextInt();
            }

            Arrays.sort(mins);
            printArr(mins);
            int count = 0;
            int lastNum = -1;
            for(int i = 0; i < n; i++){
                if(lastNum != mins[i]){
                    if(count > 0){
                        repeats.add(count);
                        System.out.print(count + "-" + lastNum + "-->");
                    }
                    lastNum = mins[i];
                    System.out.print(lastNum + ",");
                    count = 0;
                }else{
                    count++;
                }
            }
            System.out.println();
            */
        
            /*1437B
            String s = input.next() + "";
            System.out.println(s);
            int c = 0;
            boolean hitOne = false;
            for(int i = 0; i < s.length(); i++){
                if(!hitOne && s.substring(i, i + 1).equals("1")){
                    hitOne = true;
                }else if(hitOne && s.substring(i, i + 1).equals("1")){
                    c++;
                }else if(hitOne && s.substring(i, i + 1).equals("0")){
                    hitOne = false;
                }
            }
            if(s.length() >= 1 && s.substring(0, 1).equals(s.substring(s.length() - 1)) && s.substring(0, 1).equals("1")){
                c++;
            }
            System.out.println(c);*/
            
            /*1437A 
            
            int l = input.nextInt();
            int r = input.nextInt();
            
            if(r - l < l){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }*/
            
            /*int n = input.nextInt();
            int[] a = new int[n];
            int mod = 0;
            for(int i = 0; i < n; i++){
                a[i] = 4 * n - mod * 2;
                mod ++;
            }
            
            /*int[] a = new int[n];
            int index = 0;
            for(int i = 4 * n; i >= 4; i--){
                boolean accepted = true;
                for(int j = 0; j < index; j++){
                    if(a[j] % i == 0 || i % a[j] == 0 || gcd(a[j], i) == 1 ){
                        accepted = false;
                        //System.out.println("*" + a[j]+ " " + i);
                    }
//                    System.out.println("**");
                }
                
                if(accepted){
                    a[index] = i;
                    index++;
                }
                
                if(index == n){
                    break;
                }
            }
            
            for(int i = 0; i < a.length; i++){
                System.out.print(a[i] + " ");
            }
            System.out.println();
            */
            
            /*1433D
            
            int n = input.nextInt();
            int[] a = new int[n];
            int firstOther = n;
            
            boolean possible = false;
            for(int i = 0; i < n; i++){
                a[i] = input.nextInt();
                if(!possible && i != 0 && a[i] != a[i - 1]){
                    possible = true;
                    firstOther = i;
                }
            }
            
            if(possible){
                System.out.println("YES");
                int[][] toPrint = new int[n - 1][2];
                int currIndex = 0;
                for(int i = 1; i < n; i++){
                    if(a[i] != a[0]){
                        toPrint[currIndex][0] = 1;
                        toPrint[currIndex][1] = i + 1;
                    }else{
                        toPrint[currIndex][0] = firstOther + 1;
                        toPrint[currIndex][1] = i + 1;
                    }
                    currIndex++;
                }
                for(int i = 0; i < n - 1; i++){
                    System.out.println(toPrint[i][0] + " " + toPrint[i][1]);
                }
            }else{
                System.out.println("NO");
            }*/
            
            /*1433D
            
            int n = input.nextInt();
            ArrayList<Integer> s = new ArrayList<Integer>();
            for(int i = 0; i < n; i++){
                s.add(input.nextInt());
            }
            boolean done = false;
            
            for(int i = 0; i < n; i++){
                ArrayList<Integer> x = new ArrayList<Integer>();
                for(int j = 0; j < n; j++){
                    x.add(s.get(j));
                }
                int rightDiff = 1;
                int leftDiff = 1;
                int checker = x.get(i);
                while( (i - leftDiff >= 0 && x.get(i - leftDiff) < checker) || (i + rightDiff < x.size() && x.get(i + rightDiff) < checker) ){
                    if(i - leftDiff >= 0 && x.get(i - leftDiff) < checker){
                        checker++;
                        leftDiff++;
                    }else if(i + rightDiff < x.size() && x.get(i + rightDiff) < checker){
                        checker++;
                        rightDiff++;
                    }
                }
                if(i - leftDiff < 0 && i + rightDiff >= x.size()){
                    System.out.println(i + 1);
                    done = true;
                    break;
                }
                
            }
            if(!done){
                System.out.println(-1);
            }*/
            
            /*1433B 
           int n = input.nextInt();
           int[] a = new int[n];
           for(int i = 0; i < a.length; i++){
               a[i] = input.nextInt();
           }
           
           boolean pastOne = false;
           int c = 0;
           int cc = 0;
           for(int i = 0; i < a.length; i++){
               if(!pastOne){
                   if(a[i] == 1){
                       pastOne = true;
                   }
               }else{
                   if(a[i] == 0){
                       cc++;
                   }else{
                       c += cc;
                       cc = 0;
                   }
               }
           }
           System.out.println(c);*/
           
            /*1433A
            
            int[] sameNumber = {1,11,111,1111,2,22,222,2222,3,33,333,3333,4,44,444,4444,5,55,555,5555,6,66,666,6666,7,77,777,7777,8,88,888,8888,9,99,999,9999};
            
            int x = input.nextInt();
            int c = 0;
            for(int i = 0; i < sameNumber.length; i++){
                if(x == sameNumber[i]){
                    if(sameNumber[i] < 10){
                    c++;
                }else if(sameNumber[i] < 100){
                    c+=2;
                }else if(sameNumber[i] < 1000){
                    c += 3;
                }else{
                    c += 4;
                }
                    break;
                }
                
                if(sameNumber[i] < 10){
                    c++;
                }else if(sameNumber[i] < 100){
                    c+=2;
                }else if(sameNumber[i] < 1000){
                    c += 3;
                }else{
                    c += 4;
                }
            }
            
            System.out.println(c);*/
            
            /*int n = input.nextInt();
            int[] a = new int[1];
            a[0] = 1;
            int lowestMoves = 0;
            int[] factorTracker = new int[n];
            
            for(int i = 1; i <= n; i++){
                factorTracker[i - 1] = i + (n / i) - 2;
                if(n % i > 0){
                    factorTracker[i - 1]++;
                }
                if(lowestMoves == 0 || factorTracker[i - 1] < lowestMoves){
                    lowestMoves = factorTracker[i - 1];
                }else{
                    break;
                }
            }
            System.out.println(lowestMoves);*/
            
            /*1426B:
            int n = input.nextInt();
            int m = input.nextInt();
            
            boolean solved = false;
            if(m % 2 == 1){
                System.out.println("NO");
                solved = true;
            }
            
            for(int i = 0; i < n; i++){
                int upperLeft = input.nextInt();
                int upperRight = input.nextInt();
                int lowerLeft = input.nextInt();
                int lowerRight = input.nextInt();
                if(upperRight == lowerLeft && !solved){
                    System.out.println("YES");
                    solved = true;
                }
                
            }
            if(!solved){
                System.out.println("NO");
            }*/
            
            /*1426A:
            int n = input.nextInt();
            int x = input.nextInt();
            if(n <= 2){
                System.out.println(1);
            }else{
                n -= 2;
                System.out.println((int)Math.ceil((double)n / x) + 1);
            }*/
            
            /*1419C
            int n = input.nextInt();
            int x = input.nextInt();
            ArrayList<Integer> lowerRatings = new ArrayList<Integer>();
            int sigmaLR = 0;
            ArrayList<Integer> higherRatings = new ArrayList<Integer>();
            int sigmaHR = 0;
            ArrayList<Integer> sameRatings = new ArrayList<Integer>();
            
            for(int i = 0; i < n; i++){
                int r = input.nextInt();
                if(r - x < 0){
                    lowerRatings.add(r - x);
                    sigmaLR += Math.abs(r - x);
                }else if(r - n > 0){
                    higherRatings.add(r - x);
                    sigmaHR += Math.abs(r - x);
                }else{
                    sameRatings.add(r - x);
                }
            }
            if(lowerRatings.size() == 0 && higherRatings.size() == 0){
                System.out.println(0);
            }else if(sigmaHR == sigmaLR || higherRatings.size() + lowerRatings.size() < n){
                System.out.println(1);
            }else{
                System.out.println(2);
            }*/
            
            /*1419B:
            
            long x = Long.valueOf(input.next());
            int currPow = 0;
            long lastArea = 0;
            while(x - ((long)Math.pow(4, currPow)  + 2 * lastArea) >= 0){
                x -= ((long)Math.pow(4, currPow)  + 2 * lastArea);
                lastArea = ((long)Math.pow(4, currPow)  + 2 * lastArea);
                currPow++;
            }
            System.out.println(currPow);
            */
            
            /*1419A:
            
            int n = input.nextInt();
            String num = input.next();
            
            ArrayList<Integer> oddIndexes = new ArrayList<Integer>();
            ArrayList<Integer> evenIndexes = new ArrayList<Integer>();

            for(int i = 1; i <= n; i++){
                if(i % 2 == 1){
                    oddIndexes.add(Integer.valueOf(num.substring(i - 1, i)) % 10);
                }else{
                    evenIndexes.add(Integer.valueOf(num.substring(i - 1, i)) % 10);
                }
            }
            
            while(evenIndexes.size() + oddIndexes.size() > 1){
                boolean tooken = false;
                for(int i = 0; i < oddIndexes.size(); i++){
                    if(oddIndexes.get(i) % 2 == 0){
                        oddIndexes.remove(i);
                        tooken = true;
                        break;
                    }
                }
                for(int i = 0; i < oddIndexes.size() && !tooken; i++){
                    if(oddIndexes.get(i) % 2 == 1){
                        oddIndexes.remove(i);
                        break;
                    }
                }
                if(evenIndexes.size() + oddIndexes.size() > 1){
                    tooken = false;
                    for(int i = 0; i < evenIndexes.size(); i++){
                        if(evenIndexes.get(i) % 2 == 1){
                            evenIndexes.remove(i);
                            tooken = true;
                            break;
                        }
                    }
                    for(int i = 0; i < evenIndexes.size() && !tooken; i++){
                        if(evenIndexes.get(i) % 2 == 0){
                            evenIndexes.remove(i);
                            break;
                        }
                    }
                }
            }
            if(oddIndexes.size() > 0 && oddIndexes.get(0) % 2 == 0 || evenIndexes.size() > 0 && evenIndexes.get(0) % 2 == 0){
                System.out.println(2);
            }else if(oddIndexes.size() > 0 && oddIndexes.get(0) % 2 == 1 || evenIndexes.size() > 0 && evenIndexes.get(0) % 2 == 1){
                System.out.println(1);
            }
            */
        }
        
    }
    
    private static void printArr(int[] arr){
        System.out.print("[");
        for(int i = 0; i < arr.length; i++){
            System.out.print(arr[i]);
            if(i < arr.length - 1){
                System.out.print(", ");
            }
        }
        System.out.println("]");
    }
    
    private static int gcd(int a, int b){
        int s;
        int l;
        
        if(a > b){
            s = b;
            l = a;
        }else{
            s = a;
            l = b;
        }
        int gcd = 1;
        for(int i = 1; i <= s; i++){
            if(s % i == 0 && b % i == 0){
                gcd = i;
            }
        }
        return gcd;
    }
    
    private static boolean isAlternating(String s){
        String lastChar = s.substring(0, 1);
        for(int i = 1; i < s.length(); i++){
            if(!lastChar.equals(s.substring(i, i + 1))){
                return false;
            }
            lastChar = s.substring(i, i + 1);
        }
        return true;
    }
}