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.*;
import java.util.*;


/**
 * This is a template for submitting codeforces problem
 */
public class Solution {

    FastReader fastReader;
    OutputStream outputStream = System.out;
    PrintWriter out;


    public Solution(FastReader fastReader) {
        this.fastReader = fastReader;
        out = new PrintWriter(outputStream, true);
    }

    public static void main(String args[]) throws FileNotFoundException {

        // for testing in local
        //FastReader fastReader = FastReader.getFileReader("in.txt");

        FastReader fastReader = FastReader.getDefaultReader();
        Solution solution = new Solution(fastReader);
        solution.solve();
    }

    long lcm(long a, long b) {
        long res = a * b;
        res /= gcd(a, b);
        return res;
    }

    private long gcd(long a, long b) {
        if (a == 0) return b;
        if (b == 0) return a;
        return gcd(b % a, a);
    }

    private void solve() {


        int test;

        test = fastReader.nextInt();

        while ((test--) > 0) {

            int n = fastReader.nextInt();

            long res = Long.MAX_VALUE;
            long ans1, ans2;

            ans1 = ans2 = -1;

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

                long x1 = i;
                long a = n / i;

                long res1 = lcm((x1 - 1) * a, a);
                if (res1 < res) {
                    res = res1;
                    ans1 = (x1 - 1) * a;
                    ans2 = a;
                }

                x1 = n / i;
                a = i;
                res1 = lcm((x1 - 1) * a, a);
                if (res1 < res) {
                    res = res1;
                    ans1 = (x1 - 1) * a;
                    ans2 = a;
                }
            }

            if (ans1 == -1) {
                ans1 = n - 1;
                ans2 = 1;
            }
            System.out.println(ans1 + " " + ans2);
        }

    }

    private void print(int[] a) {
        for (int num : a) {
            System.out.print(num);
            System.out.print(" ");
        }
        System.out.println();
    }


    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public static FastReader getFileReader(String fileName) throws FileNotFoundException {
            return new FastReader(new InputStreamReader(new FileInputStream(new File("in.txt"))));
        }

        public static FastReader getDefaultReader() throws FileNotFoundException {
            return new FastReader();
        }

        public FastReader(InputStreamReader inputStreamReader) {
            br = new BufferedReader(inputStreamReader);
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            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 (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }


}