1. 

/**
* FWP: Ausgewaehlte Probleme aus dem ACM (SS10)
*
* Method: Math: Primes
* Problem: 583 - PrimeFactors
* Accepted: 2.620
* @author Evgeni Pavlidis
*
*/
import java.io.*;
import java.util.*;

class Main {


public static final int MAX = (int)Math.sqrt(2147483648l);
public static final boolean[] isPrime = new boolean[MAX+1];
public static final int prime[] = new int[MAX];
public static int maxPrime = 0;
private static int a,b,c,d;

private static void sievePrimes()
{
for(int i = 2; i <= MAX; i++)
isPrime[i] = true;
// sieve the multiples of 2
for(int i = 4; i <= MAX; i+=2)
isPrime[i] = false;

prime[maxPrime++] = 2;

// sieve other numbers
int squareRoot = (int)Math.sqrt(MAX);
for(int i = 3; i <= MAX; i+=2)
if(isPrime[i])
{
prime[maxPrime++] = i;
for(int j = i+i; j <= MAX; j += i)
isPrime[j] = false;
}

/** /
for(int i = 1; i < maxPrime; i++)
System.out.println(prime[i]);
/**/

}

private static String calc(int n)
{
StringBuffer result = new StringBuffer();

if(n < 0)
{
result.append(" x -1");
n = n * -1;
}

for(int i=0; i < maxPrime; i++)
while(n % prime[i] == 0)
{
n /= prime[i];
result.append(" x " + prime[i]);
}

if(n != 1)
result.append(" x " + n);

result.delete(0, 3);

return result.toString();
}

public static void main(String...args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input;
int n;

sievePrimes();

while( (input = reader.readLine()) != null )
{
n = Integer.parseInt(input);
if(n == 0)
break;

System.out.println(n + " = " + calc(n));
}
}
}