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.*;
import java.math.*;
import java.lang.*;
 
import static java.lang.Math.*;
 
public class MakingString implements Runnable 
{
    static class InputReader 
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        public InputReader(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 String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        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 double nextDouble() 
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') 
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
    
        public String readString() 
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = read();
            } 
            while (!isSpaceChar(c));
            
            return res.toString();
        }
     
        public boolean isSpaceChar(int c) 
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
     
        public String next()
        {
            return readString();
        }
        
        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
	
	
	// if modulo is required set value accordingly
	public static long[][] matrixMultiply2dL(long t[][],long m[][])
	{
		long res[][]= new long[t.length][m[0].length];
		
		for(int i=0;i<t.length;i++)
		{
			for(int j=0;j<m[0].length;j++)
			{
				res[i][j]=0;
				for(int k=0;k<t[0].length;k++)
				{
					res[i][j]+=t[i][k]+m[k][j];
				}
			}
		}
		
		return res;
	}
	
	static long combination(long n,long r)
	{
		long ans=1;
		for(long i=0;i<r;i++)
		{
			ans=(ans*(n-i))/(i+1);
		}
		return ans;
	}
	static int mat(String a,String b)
	{
	    int count=0;
	    for(int i=0;i<a.length();i++)
	    {
	        if(a.charAt(i)!=b.charAt(i))
	            count++;
	        
	    }
	    
	    return count;
	}
	
	static int accumulate(int arr[], int first, 
                                     int last) 
    { 
        int init = 0; 
        for (int i = first; i< last; i++) { 
            init = init + arr[i]; 
        } 
      
        return init; 
    } 
  
    // Returns true if it is possible to divide  
    // array into two halves of same sum.  
    // This function mainly uses combinationUtil() 
    static Boolean isPossible(int arr[], int n) 
    { 
        // If size of array is not even. 
        if (n % 2 != 0) 
            return false; 
  
        // If sum of array is not even. 
        int sum = accumulate(arr, 0, n); 
        if (sum % 2 != 0) 
            return false; 
  
        // A temporary array to store all  
        // combination one by one int k=n/2; 
        int half[] = new int[n/2]; 
  
        // Print all combination using temporary 
        // array 'half[]' 
        return combinationUtil(arr, half, 0, n - 1, 
                                0, n, sum); 
    } 
  
    /* arr[] ---> Input Array 
    half[] ---> Temporary array to store current  
                combination of size n/2 
    start & end ---> Staring and Ending indexes in arr[] 
    index ---> Current index in half[] */
    static Boolean combinationUtil(int arr[], int half[],  
                                   int start, int end, 
                                   int index, int n, 
                                   int sum) 
    { 
        // Current combination is ready to  
        // be printed, print it 
        if (index == n / 2) { 
            int curr_sum = accumulate(half, 0 , n/2); 
            return (curr_sum + curr_sum == sum); 
        } 
  
        // replace index with all possible elements.  
        // The condition "end-i+1 >= n/2-index" makes 
        // sure that including one element at index  
        // will make a combination with remaining 
        // elements at remaining positions 
        for (int i = start; i <= end && end - i + 1 >=  
                                  n/2 - index; i++) { 
            half[index] = arr[i]; 
            if (combinationUtil(arr, half, i + 1, end,  
                                 index + 1, n, sum)) 
                return true; 
        } 
  
        return false; 
    } 
    static int gcd(int a, int b) 
    { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    } 
    public static void main(String args[]) throws Exception 
    {
        new Thread(null, new MakingString(),"MakingString",1<<27).start();
    }
	// **just change the name of class from Main to reuquired**
    public void run()
    {
        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
		
	    
	    
	    
	        int n = sc.nextInt();
	        for(int j=0;j<n;j++)
	        {
	           int x = sc.nextInt();
	           int i=2;
	           boolean b=false;
	           double p = Math.sqrt(x);
	           int p1=(int)Math.ceil(p);
	           for(i=2;i<=p1;i++)
	            {
	                if(x%i==0)
	                {
	                    b=true;
	                    break;
	                }
	            }
	            if(b)
	            {
	                int temp1=x/i;
	                int temp2=x-temp1;
	                w.println(temp1+" "+temp2);
	            }
	            else
	            {
	                int temp1=1;
	                int temp2=x-1;
	                w.println(temp1+" "+temp2);
	            }
	            
	           
	        }
	        
	        
	        
	        
	        
	    
        
    
	    
	    
        System.out.flush();
        w.close();
        
    }
}