Welcome to Rockport City!

It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,b), where gcd(x, y) denotes the [greatest common divisor (GCD)](https://en.wikipedia.org/wiki/Greatest_common_divisor) of integers x and y. To make the race more exciting, you can perform two types of operations:

  1. Increase both a and b by 1. 
  2. Decrease both a and b by 1. This operation can only be performed if both a and b are greater than 0. 



In one move, you can perform any one of these operations. You can perform arbitrary (possibly zero) number of moves. Determine the maximum excitement the fans can get and the minimum number of moves required to achieve it.

Note that gcd(x,0)=x for any x ≥ 0.

Input

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

The first and the only line of each test case contains two integers a and b (0≤ a, b≤ 10^{18}).

Output

For each test case, print a single line containing two integers. 

If the fans can get infinite excitement, print 0 0.

Otherwise, the first integer must be the maximum excitement the fans can get, and the second integer must be the minimum number of moves required to achieve that excitement.

Example

Input


4
8 5
1 2
4 4
3 9


Output


3 1
1 0
0 0
6 3

Note

For the first test case, you can apply the first operation 1 time to get a=9 and b=6. It can be shown that 3 is the maximum excitement possible.

For the second test case, no matter how many operations you apply, the fans will always have an excitement equal to 1. Since the initial excitement is also 1, you don't need to apply any operation.

For the third case, the fans can get infinite excitement by applying the first operation an infinite amount of times.

For the fourth test case, you can apply the second operation 3 times to get a=0 and b=6. Since, gcd(0,6)=6, the fans will get an excitement of 6.
// package com.company

/*
 * @author :: Yuvraj Singh
 * CS UNDERGRAD AT IT GGV BILASPUR
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.lang.System.out;
import static java.lang.Long.MAX_VALUE;

public final class Main{

    FastReader in;
    StringBuffer sb;
    public static void main(String[] args) {
        new Main().run();
    }

    void run(){
        in= new FastReader();
        start();
    }

    void start(){
        sb= new StringBuffer();
        for(int t=in.nextInt();t>0;t--)
            solve();

        out.print(sb);
    }

    void solve(){
        long a= in.nextLong();
        long b= in.nextLong();
        long p= abs(a-b);
        if(p==0){
            sb.append(0).append(" ").append(0).append(" ");
            return;
        }
        sb.append(p).append(" ");
        sb.append(min(p-a%p, a%p)).append(" ");
    }

    int upper_bound(long[] arr, int key) {
        int i=0, j=arr.length-1;
        if (arr[j]<=key) return j+1;
        if(arr[i]>key) return i;
        while (i<j){
            int mid= (i+j)/2;
            if(arr[mid]<=key){
                i= mid+1;
            }else{
                j=mid;
            }
        }
        return i;
    }

    void sort(long[] A){
        int n = A.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i){
            long tmp = A[i];
            int randomPos = i + rnd.nextInt(n-i);
            A[i] = A[randomPos];
            A[randomPos] = tmp;
        }
        Arrays.sort(A);
    }

    long[] longArr(int n){
        long[] res= new long[n];
        for(int i=0;i<n;i++){
            res[i]= in.nextLong();
        }
        return res;
    }

    // sieve of eratosthenes code for precomputing whether numbers are prime or not up to MAX_VALUE
    long MAX= MAX_VALUE;
    int[] precomp= new int[(int) (MAX+1)];
    void sieve(){
        long n= MAX;
        boolean[] prime = new boolean[(int) (n+1)];
        for(int i=0;i<=n;i++)
            prime[i] = true;

        for(long p = 2; p*p <=n; p++)
        {
            // If prime[p] is not changed, then it is a prime
            if(prime[(int) p])
            {
                // Update all multiples of p
                for(long i = p*p; i <= n; i += p)
                    prime[(int) i] = false;
            }
        }

        // Print all prime numbers
        for(long i = 2; i <= n; i++)
        {
            if(prime[(int) i])
                precomp[(int) i]= 1;
        }
    }

    boolean isDigitSumPalindrome(long N) {
        // code here
        long sum= sumOfDigits(String.valueOf(N));
        long rev=0;
        long org= sum;
        while (sum!=0){
            long d= sum%10;
            rev = rev*10 +d;
            sum /= 10;
        }
        return org == rev;
    }

    long sumOfDigits(String n){
        long sum= 0;
        for (char c: n.toCharArray()){
            sum += Integer.parseInt(String.valueOf(c));
        }
        return sum;
    }

    long[] revArray(long[] arr) {
        int n= arr.length;
        int i=0, j=n-1;
        while (i<j){
            long temp= arr[i];
            arr[i]= arr[j];
            arr[j]= temp;
            i++;
            j--;
        }
        return arr;
    }

    long gcd(long a, long b){
        if (b==0)
            return a;
        return gcd(b, a%b);
    }
    long lcm(long a,long b){
        return (a*b)/gcd(a,b);
    }

    static class Pair{
        long first;
        long second;
        Pair(long x,long y){
            this.first=x;
            this.second=y;
        }
    }

    static class Compare {
        static void compare(ArrayList<Pair> arr, long n) {
            arr.sort(new Comparator<Pair>() {
                @Override
                public int compare(Pair p1, Pair p2) {
                    return (int) (p1.first - p2.first);
                }
            });
        }
    }

    public 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){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt(){
            return Integer.parseInt(next());
        }
        long nextLong(){
            return Long.parseLong(next());
        }
        double nextDouble(){
            return Double.parseDouble(next());
        }
        float nextFloat(){
            return Float.parseFloat(next());
        }
        String nextLine(){
            String str="";
            try{
                str=br.readLine();
            }catch (Exception e){
                e.printStackTrace();
            }
            return str;
        }
    }
}