description: Gregor is learning about RSA cryptography, and although he doesn't understand how RSA works, he is now fascinated with prime numbers and factoring them.
  
  Gregor's favorite prime number is P. Gregor wants to find two bases of P. Formally, Gregor is looking for two integers a and b which satisfy both of the following properties.
  
    * P mod a = P mod b, where x mod y denotes the remainder when x is divided by y, and 
    * 2 ≤ a < b ≤ P. 
  
  
  
  Help Gregor find two bases of his favorite prime number!
  
  Input
  
  Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 1000).
  
  Each subsequent line contains the integer P (5 ≤ P ≤ {10}^9), with P guaranteed to be prime.
  
  Output
  
  Your output should consist of t lines. Each line should consist of two integers a and b (2 ≤ a < b ≤ P). If there are multiple possible solutions, print any.
  
  Example
  
  Input
  
  
  2
  17
  5
  
  
  Output
  
  
  3 5
  2 4
  
  Note
  
  The first query is P=17. a=3 and b=5 are valid bases in this case, because 17 mod 3 = 17 mod 5 = 2. There are other pairs which work as well.
  
  In the second query, with P=5, the only solution is a=2 and b=4.
solution: import java.util.*;
  import java.io.*;
  import java.math.*;
  import java.util.LinkedList;
  public class Main
  {
     
      public static void process()throws IOException
      {
       int n=ni();
       if(n%2!=0)
        pn(2+" "+(n-1));
      else
        pn(2+" "+n);
      }
      
       
      
      static AnotherReader sc;
      static PrintWriter out;
      public static void main(String[]args)throws IOException
      {
          out = new PrintWriter(System.out);
          sc=new AnotherReader();
          boolean oj = true;
  
             //PrintWriter out=new PrintWriter("output");
          //oj = System.getProperty("ONLINE_JUDGE") != null;
          //if(!oj) sc=new AnotherReader(100);
      //int T=ni(); while(T-->0)
        //process();
   //   int i=1;
        int T=ni();
   while(T-->0)
   //     {
   //      p("Case #"+i+": ");
              process();
      //         i++;
      // }
          long s = System.currentTimeMillis();
        
          out.flush();
          if(!oj)
              System.out.println(System.currentTimeMillis()-s+"ms");
          System.out.close();  
      }
      static void sort(long arr[],int n)
      {
      shuffle(arr,n);
      Arrays.sort(arr);
      }
      static void shuffle(long arr[],int n)
      {
          Random r=new Random();
          for(int i=0;i<n;i++)
          {
            long temp=arr[i];
            int pos=i+r.nextInt(n-i);
            arr[i]=arr[pos];
            arr[pos]=temp;
          }
      }
   
      static void pn(Object o){out.println(o);}
      static void p(Object o){out.print(o);}
      static void pni(Object o){out.println(o);System.out.flush();}
      static int ni()throws IOException{return sc.nextInt();}
      static long nl()throws IOException{return sc.nextLong();}
      static double nd()throws IOException{return sc.nextDouble();}
      static String nln()throws IOException{return sc.nextLine();}
      static String nn()throws IOException{return sc.next();}
      static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
      static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
      static long bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
      static int[] iarr(int N)throws IOException{int[]ARR=new int[N];for(int i=0;i<N;i++){ARR[i]=ni();}return ARR;}
      static long[] larr(int N)throws IOException{long[]ARR=new long[N];for(int i=0;i<N;i++){ARR[i]=nl();}return ARR;}
      static boolean multipleTC=false;
              
   
  /////////////////////////////////////////////////////////////////////////////////////////////////////////
      static class AnotherReader{BufferedReader br; StringTokenizer st;
      AnotherReader()throws FileNotFoundException{
      br=new BufferedReader(new InputStreamReader(System.in));}
      AnotherReader(int a)throws FileNotFoundException{
      br = new BufferedReader(new FileReader("input.txt"));}
      String next()throws IOException{
      while (st == null || !st.hasMoreElements()) {try{
      st = new StringTokenizer(br.readLine());}
      catch (IOException  e){ e.printStackTrace(); }}
      return st.nextToken(); } int nextInt() throws IOException{
      return Integer.parseInt(next());}
      long nextLong() throws IOException
      {return Long.parseLong(next());}
      double nextDouble()throws IOException { return Double.parseDouble(next()); }
      String nextLine() throws IOException{ String str = ""; try{
      str = br.readLine();} catch (IOException e){
      e.printStackTrace();} return str;}}
   
      
  /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  }