#include <iostream>
#include <math.h>
using namespace std;

struct factor{
int x, cnt; //x为质因子,cnt为该质因子的个数
}fac[10];

bool isPrime(int num){

if(num <=1 ){
return false;
}

int n = (int)sqrt(num*1.0);
for(int i = 1; i < n; i++){
if(num % n == 0){
return false;
}
}
return true;
}

int main(int argc, char** argv) {

long long int n;
cin >> n;

if(n == 1){
cout << "1=1" << endl;
return 0;
}
cout << n << "=";

int sqr = (int)sqrt(n*1.0);
int count = 0;
for(int i = 0; i <= sqr; i++){
if(isPrime(i) == true){
if(n % i == 0){ //如果是他的因子
fac[count].x = i;
fac[count].cnt = 0;
while(n % i == 0){
fac[count].cnt++;
n /= i;
}
count++;
}
}
}

if(n != 1){
fac[count].x = n;
fac[count++].cnt = 1;
}

for(int i = 0; i < count; i++){
if(i > 0) cout << "*";
cout << fac[i].x ;
if(fac[i].cnt > 1){
cout << "^" << fac[i].cnt;
}
}

return 0;
}