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: // Author : RegalBeast
  
  import java.io.*;
  import java.util.*;
  import java.util.concurrent.*;
  
  public class Main implements Runnable {
    static Input in = new Input();
    static PrintWriter out = Output();
    
    public static void main(String[] args) {
      new Thread(null, new Main(), String.join(
                                    "All that is gold does not glitter,",
                                    "Not all those who wander are lost;",
                                    "The old that is strong does not wither,",
                                    "Deep roots are not reached by the frost.",
                                    
                                    "From the ashes a fire shall be woken,",
                                    "A light from the shadows shall spring;",
                                    "Renewed shall be blade that was broken,",
                                    "The crownless again shall be king."
                                  ), 1<<25).start();
    }
  
    public void run() {
      int tests = in.nextInt();
      for (int t = 0; t < tests; t++) {
          int prime = in.nextInt();
          int first = 2;
          int second = prime - 1;
          out.println(first + " " + second);
      }
  
      in.close();
      out.close();
    }
    
    static PrintWriter Output() {
      return new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    }
    
    static PrintWriter Output(String fileName) {
      PrintWriter pw = null;
      try {
        pw = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
      } catch (IOException ex) {
        ex.printStackTrace();
      }
      return pw;
    }
  }
  
  class Input {
    BufferedReader br;
    StringTokenizer st;
    public Input() {
      br = new BufferedReader(new InputStreamReader(System.in));
    }
  
    public Input(String fileName) {
      try {
        br = new BufferedReader(new FileReader(fileName));
      } catch (IOException ex) {
        ex.printStackTrace();
      }
    }
  
    public String next() {
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException ex) {
          ex.printStackTrace();
        }
      }
      return st.nextToken();
    }
  
    public int nextInt() {
      return Integer.parseInt(next());
    }
  
    public long nextLong() {
      return Long.parseLong(next());
    }
  
    public Float nextFloat() {
      return Float.parseFloat(next());
    }
  
    public Double nextDouble() {
      return Double.parseDouble(next());
    }
  
    public String nextLine() {
      if (st != null && st.hasMoreElements()) {
        StringBuilder sb = new StringBuilder();
        while (st.hasMoreElements()) {
          sb.append(next());
        }
        return sb.toString();
      }
  
      String str = null;
      try {
        str = br.readLine();
      } catch (IOException ex) {
        ex.printStackTrace();
      }
      return str;
    }
  
    public void close() {
      try {
        br.close();
      } catch (IOException ex) {
        ex.printStackTrace();
      }
    }
  }
  