import java.util.*;
import java.util.stream.*;

class FastFactoring
{
	public static void main (String[] args)
	{
		long num = Integer.MAX_VALUE;
		Map<Long, Integer> factors = factorize(num);
		
		//Printing out the map...
		System.out.printf("%d = ", num);
            if (factors.get(num) != null) {
                System.out.print("PRIME");
            } else {
                Iterator<Long> factorKeys = factors.keySet().iterator();
                for (int j = 0; j < factors.size(); j++) {
                    long factor = factorKeys.next();
                    int count = factors.get(factor);
                    if (count > 1) {
                        System.out.printf("%d^%d", factor, count);
                    } else {
                        System.out.printf("%d", factor);
                    }
                    if (j + 1 != factors.size()) {
                        System.out.print("×");
                    }
                }
            }
            System.out.println();
	}
	
	public static Map<Long, Integer> factorize(long num) {
        Map<Long, Integer> factors = new LinkedHashMap<>();
        long n = num;
        for (long i = 2; i <= n / i; i++) {
            int count = 0;
            while (n % i == 0) {
                count++;
                n /= i;
            }
            if (count > 0) {
                factors.put(i, count);

            }
        }
        if (n > 1) {
            factors.put(n, 1);
        }
        return factors;
    }
}