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.io.*;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.Period;
import static java.time.temporal.TemporalQueries.localDate;
import java.util.*;
import java.math.RoundingMode;

/*                               I   S   H   M   A   M
                                   R   U   H   A   N
 */
public class Main {

    private static String[] GetStringArray(ArrayList<String> ar) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    //Fastest I/O Class Start
    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 (Exception e) {

                }
            }
            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 (Exception e) {

            }
            return str;
        }

    }
    //Fastest I/O Class End

    //Fastest Backup I/O Class Start
    static class CustomScanner {

        private final InputStream ins;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        CustomScanner() {
            this(System.in);
        }

        CustomScanner(InputStream in) {
            ins = in;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = ins.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte()) {
                return buffer[ptr++];
            } else {
                return -1;
            }
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
            return hasNextByte();
        }

        public String next() {
            return nextBuilder().toString();
        }

        public StringBuilder nextBuilder() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || Integer.MAX_VALUE < nl) {
                throw new NumberFormatException();
            }
            return (int) nl;
        }

        public String[] nextA(int n) {
            String[] a = new String[n];
            nextA(a, n);
            return a;
        }

        public void nextA(String[] a, int n) {
            nextA(a, 0, n);
        }

        public void nextA(String[] a, int off, int len) {
            for (int i = off; i < off + len; i++) {
                a[i] = next();
            }
        }

        public int[] nextAInt(int n) {
            int[] a = new int[n];
            nextAInt(a, n);
            return a;
        }

        public void nextAInt(int[] a, int n) {
            nextAInt(a, 0, n);
        }

        public void nextAInt(int[] a, int off, int len) {
            for (int i = off; i < off + len; i++) {
                a[i] = nextInt();
            }
        }

        public long[] nextALong(int n) {
            long[] a = new long[n];
            nextALong(a, n);
            return a;
        }

        public void nextALong(long[] a, int n) {
            nextALong(a, 0, n);
        }

        public void nextALong(long[] a, int off, int len) {
            for (int i = off; i < off + len; i++) {
                a[i] = nextLong();
            }
        }

        public double[] nextADouble(int n) {
            double[] a = new double[n];
            nextADouble(a, n);
            return a;
        }

        public void nextADouble(double[] a, int n) {
            nextADouble(a, 0, n);
        }

        public void nextADouble(double[] a, int off, int len) {
            for (int i = off; i < off + len; i++) {
                a[i] = nextDouble();
            }
        }

        public List<Integer> nextLInt(int n) {
            List<Integer> l = new ArrayList<>(n);
            for (int i = 0; i < n; i++) {
                l.add(in.nextInt());
            }
            return l;
        }

        public List<Long> nextLLong(int n) {
            List<Long> l = new ArrayList<>(n);
            for (int i = 0; i < n; i++) {
                l.add(in.nextLong());
            }
            return l;
        }

        public List<Double> nextLDouble(int n) {
            List<Double> l = new ArrayList<>(n);
            for (int i = 0; i < n; i++) {
                l.add(in.nextDouble());
            }
            return l;
        }
    }

    //Fastest Backup I/O Class End
    //Super Fast I/O class Start
    static class Reader {

        BufferedReader br;
        StringTokenizer st;
        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;
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {

                }
            }
            return st.nextToken();
        }

        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[64]; // 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();
        }
    }

    //Super Fast I/O Class End
    //public int sum = 0;
    //static int maxN = 10000007;
    //static long[] dp = new long[maxN];
    //static TreeMap<Integer, Integer> map = new TreeMap<>();
    static InputStream inputStream = System.in;
    static CustomScanner in = new CustomScanner(inputStream);

    int gcd(int a, int b) {
        if (a == 0) {
            return Math.abs(b);
        }
        if (b == 0) {
            return Math.abs(a);
        }
        a = Math.abs(a);
        b = Math.abs(b);
        int az = Integer.numberOfTrailingZeros(a), bz = Integer.numberOfTrailingZeros(b);
        a >>>= az;
        b >>>= bz;
        while (a != b) {
            if (a > b) {
                a -= b;
                a >>>= Integer.numberOfTrailingZeros(a);
            } else {
                b -= a;
                b >>>= Integer.numberOfTrailingZeros(b);
            }
        }
        return (a << Math.min(az, bz));
    }

    long gcd(long a, long b) {
        if (a == 0) {
            return Math.abs(b);
        }
        if (b == 0) {
            return Math.abs(a);
        }
        a = Math.abs(a);
        b = Math.abs(b);
        int az = Long.numberOfTrailingZeros(a), bz = Long.numberOfTrailingZeros(b);
        a >>>= az;
        b >>>= bz;
        while (a != b) {
            if (a > b) {
                a -= b;
                a >>>= Long.numberOfTrailingZeros(a);
            } else {
                b -= a;
                b >>>= Long.numberOfTrailingZeros(b);
            }
        }
        return (a << Math.min(az, bz));
    }

    //get power in O(sqrt-n) complexity
    public long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b % 2 == 0) {
            return pow(a * a, b / 2);
        } else {
            return a * pow(a, b - 1);
        }
    }

    boolean isPrimeInt(int n) {
        if (n == 1 || n == 0) {
            return false;
        }

        for (int i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return false;
            }
        }

        return true;
    }

    boolean isPrimeLong(long n) {
        if (n == 1 || n == 0) {
            return false;
        }

        for (long i = 2; i * i <= n; i++) {
            if (n % i == 0) {
                return false;
            }
        }

        return true;
    }

    Integer[] seivePrimes = new Integer[0];

    void eratosthenesSeive() {
        Integer maxN = 0;

        //seivePrimes[0] = seivePrimes[1] = 0;
        for (int i = 2; i * i <= maxN; i++) {
            if (seivePrimes[i] == null) {
                for (int j = i * i; j <= maxN; j += i) {
                    seivePrimes[j] = 0;
                }
            }
        }
    }

    //get sub sequence
    public static ArrayList<String> getAllSubSequence(String str) {
        if (str.length() == 0) {
            ArrayList<String> empty = new ArrayList<>();
            empty.add("");
            return empty;
        }

        char ch = str.charAt(0);

        String subStr = str.substring(1);

        ArrayList<String> subSequences = getAllSubSequence(subStr);

        ArrayList<String> res = new ArrayList<>();
        for (String val : subSequences) {
            res.add(val);
            res.add(ch + val);
        }

        res.remove("");

        return res;
    }

    public static void main(String[] args) throws IOException {
        //Main mn = new Main();
        // I/O System start
        //FastReader in2 = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        // I/O System End

        //write code main driver
        Solver solver = new Solver();
        solver.solve(out);
        out.flush();
        out.close();
        //write end code
    }

    static class Solver {

        Main mn = new Main();

        //Take Input
        //Working with data
        public void solve(PrintWriter out) {

            int t = in.nextInt();

            while (t-- != 0) {

                int x = in.nextInt();
                int y = in.nextInt();

                out.println((x-1)+" "+y);
                out.flush();
            }

        }
    }
}
