*
* Problem #10879 - Code Refractoring
*
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=100&problem=1820&mosmsg=Submission+received+with+ID+8507618
*
* @author Mariya Vlaseva
*
* Status : Accepted
* Runtime: 0.876
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws
NumberFormatException, IOException {
BufferedReader console = new
BufferedReader(new InputStreamReader(System.in));
int
cases=Integer.parseInt(console.readLine());
int A,K,C = 0;
for(int i=0;i<cases;i++){
K=Integer.parseInt(console.readLine());
if
(K>10000000){
break;
}
A=lookAt(K,0,0);
C=lookAt(K,A,K/A);
System.out.println("Case #" + (i+1) + ": " + K + " = " + A + " * " +
K/A + " = " + C + " * " + K/C);
}
}
private static int lookAt(int K, int A, int B) {
for(int i = 2;
i < K/2; i++) {
if(K%i==0 && A!=i && B!=i) {
return i;
}
}
return 0;
}
}