In Omkar's last class of math, he learned about the least common multiple, or LCM. LCM(a, b) is the smallest positive integer x which is divisible by both a and b.

Omkar, having a laudably curious mind, immediately thought of a problem involving the LCM operation: given an integer n, find positive integers a and b such that a + b = n and LCM(a, b) is the minimum value possible.

Can you help Omkar solve his ludicrously challenging math problem?

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10). Description of the test cases follows.

Each test case consists of a single integer n (2 ≤ n ≤ 10^{9}).

Output

For each test case, output two positive integers a and b, such that a + b = n and LCM(a, b) is the minimum possible.

Example

Input


3
4
6
9


Output


2 2
3 3
3 6

Note

For the first test case, the numbers we can choose are 1, 3 or 2, 2. LCM(1, 3) = 3 and LCM(2, 2) = 2, so we output 2 \ 2.

For the second test case, the numbers we can choose are 1, 5, 2, 4, or 3, 3. LCM(1, 5) = 5, LCM(2, 4) = 4, and LCM(3, 3) = 3, so we output 3 \ 3.

For the third test case, LCM(3, 6) = 6. It can be shown that there are no other pairs of numbers which sum to 9 that have a lower LCM.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.HashMap;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int T = in.nextInt();
            while (T-- > 0)
            {
                solve(in, out);
            }
        }

        private void solve(Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            if (N % 2 == 0)
            {
                out.println(N / 2 + " " + N / 2);
                return;
            }

            Map<Integer, Integer> map = CPUtils.factorize(N);
            List<Long> L = new ArrayList<>();
            for (int key : map.keySet())
            {
                for (int i = 0; i < map.get(key); i++)
                {
                    L.add((long) key);
                }
            }

            long min = Integer.MAX_VALUE;
            long w_a = 1, w_b = 1;
            for (int bits = 1; bits < 1 << L.size(); bits++)
            {
                long mul = 1;
                for (int i = 1; i <= 30 && i <= L.size(); i++)
                {
                    if (CPUtils.getIthBitFromInt(bits, i) > 0)
                    {
                        mul *= L.get(i - 1);
                        long a = N / mul;
                        long b = N - a;
                        long lcm = CPUtils.lcm(a, b);
                        if (min > lcm)
                        {
                            min = lcm;
                            w_a = a;
                            w_b = b;
                        }
                    }
                }
            }
            out.println(w_a + " " + w_b);
        }

    }

    static class CPUtils
    {
        public static long gcd(long n1, long n2)
        {
            if (n2 == 0)
            {
                return n1;
            }
            return gcd(n2, n1 % n2);
        }

        public static long lcm(long n1, long n2)
        {
            return n1 * n2 / gcd(n1, n2);
        }

        public static int getIthBitFromInt(int bits, int i)
        {
            return (bits >> (i - 1)) & 1;
        }

        public static Map<Integer, Integer> factorize(int N)
        {
            Map<Integer, Integer> factors = new HashMap<>();
            while (N % 2 == 0)
            {
                factors.put(2, factors.getOrDefault(2, 0) + 1);
                N /= 2;
            }

            for (int i = 3; i <= Math.sqrt(N); i += 2)
            {
                while (N % i == 0)
                {
                    factors.put(i, factors.getOrDefault(i, 0) + 1);
                    N /= i;
                }
            }

            if (N > 2)
                factors.put(N, factors.getOrDefault(N, 0) + 1);
            return factors;
        }

    }
}

