#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool isprime(ll a){
if(a==1) return false;
if(a==2) return true;
int flag=0;
for(ll i=2;i<=sqrt(a);i++){
if(a%i==0){
flag=1; return false;
}
}
if(flag==0) return true;
}
int main()
{
ll n;
cin>>n;
cout<<n<<"=";
if(n==1){
cout<<n;return 0;
}
map<ll,ll> mp;
for(ll i=2;i<=sqrt(n);i++){
while(isprime(i)==true&&n%i==0){
mp[i]++;
n/=i;
}
}
if(n!=1)
mp[n]++;
for(auto it=mp.begin();it!=mp.end();it++){
if(it->second==1){
if(it==mp.begin()){
cout<<it->first;
}else{
cout<<"*"<<it->first;
}
}else{
if(it==mp.begin()){
cout<<it->first<<"^"<<it->second;
}else{
cout<<"*"<<it->first<<"^"<<it->second;
}
}
}
return 0;
}