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.InputMismatchException;
import java.io.IOException;
import java.util.Collections;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * 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;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BOmkarAndLastClassOfMath solver = new BOmkarAndLastClassOfMath();
        solver.solve(1, in, out);
        out.close();
    }

    static class BOmkarAndLastClassOfMath {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            int t = s.nextInt();
            while (t-- > 0) {
                long n = s.nextLong();
                ArrayList<Long> list = new ArrayList<>();
                for (long i = 1; i <= Math.sqrt(n); i++) {
                    if (0L == n % i) {
                        list.add(i);
                        long x = n / i;
                        if (i != x) {
                            list.add(x);
                        }
                    }
                }

                ArrayList<BOmkarAndLastClassOfMath.trilet> ans = new ArrayList<>();
                Collections.sort(list);
                for (int i = 0; i < list.size(); i++) {
                    long x = list.get(i);
                    long y = n - x;
                    if (x == 0) {
                        continue;
                    }

                    if (y == 0) {
                        continue;
                    }
                    long lcm = lcm(x, y);
                    ans.add(new BOmkarAndLastClassOfMath.trilet(lcm, x, y));
                }
                Collections.sort(ans);
                out.println(ans.get(0).se + " " + ans.get(0).th);
            }
        }

        long lcm(long x, long y) {
            long gcd = BOmkarAndLastClassOfMath.Maths.gcd(x, y);
            long val = (x * y) / gcd;
            return val;
        }

        private static class trilet implements Comparable<BOmkarAndLastClassOfMath.trilet> {
            long f;
            long se;
            long th;

            public trilet(long f, long se, long th) {
                this.f = f;
                this.se = se;
                this.th = th;
            }

            public int compareTo(BOmkarAndLastClassOfMath.trilet o) {
                if (this.f == o.f) {
                    if (this.se == o.se) {
                        return Long.compare(this.th, o.th);
                    }

                    return Long.compare(this.se, o.se);
                }

                return Long.compare(this.f, o.f);
            }

        }

        private static class Maths {
            private static long gcd(long a, long b) {
                if (b == 0) {
                    return a;
                }

                return gcd(b, a % b);
            }

        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

