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.prituladima;

import java.io.*;
import java.util.StringTokenizer;

/**
 * Provide prove of correctness before implementation. Implementation can cost a lot of time.
 * Anti test that prove that it's wrong.
 * <p>
 * Do not confuse i j k g indexes. Do extra methods.
 * <p>
 * Will program ever exceed limit?
 * Try all approaches with prove of correctness if task is not obvious.
 * Analytic solution/Hardcoded solution/Constructive/Greedy/DP/Math/Brute force/Symmetric data
 * Number theory
 * Game theory (optimal play) that consider local and global strategy.
 */
public class A {

    private void solve_() {
        long a = nextLong();
        long b = nextLong();
        if (a == b) {
            println("0 0");
        } else if (b == 0) {
            println(a + " 0");
        } else if (a == 0) {
            println(b + " 0");
        } else {
            println(ans(a, b));
        }
    }

    String ans(long a, long b){
        if(a < b) {
            return ans(b, a);
        }

        long diff = a - b;
        long upper = divF(a, diff) * diff;
        long lower = div(a, diff) * diff;
        long min = Math.min(upper - a, a - lower);

        return diff + " " + min;
    }

    long div(long a, long b) {
        return a / b;
    }

    long divF(long a, long b) {
        return (a + b - 1) / b;
    }

    private void solve() {
        int t = nextInt();
        for (int i = 0; i < t; i++) {
            solve_();
        }
    }

    public static void main(String[] args) {
        new A().run();
    }

    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private PrintWriter writer;

    private void run() {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
             PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out))) {
            this.reader = reader;
            this.writer = writer;
            solve();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private int nextInt(int radix) {
        return Integer.parseInt(nextToken(), radix);
    }

    private int nextInt() {
        return Integer.parseInt(nextToken());
    }

    private long nextLong(int radix) {
        return Long.parseLong(nextToken(), radix);
    }

    private long nextLong() {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    private int[] nextIntArr(int size) {
        int[] arr = new int[size];
        for (int i = 0; i < size; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    private long[] nextLongArr(int size) {
        long[] arr = new long[size];
        for (int i = 0; i < size; i++) {
            arr[i] = nextLong();
        }
        return arr;
    }

    private double[] nextDoubleArr(int size) {
        double[] arr = new double[size];
        for (int i = 0; i < size; i++) {
            arr[i] = nextDouble();
        }
        return arr;
    }

    private String nextToken() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    private void printf(String format, Object... args) {
        writer.printf(format, args);
    }

    private void print(Object o) {
        writer.print(o);
    }

    private void println() {
        writer.println();
    }

    private void println(Object o) {
        writer.println(o);
    }

    private void flush() {
        writer.flush();
    }

}