#include<iostream>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<string>
#include<vector>
#include<sstream>
#include<cstdlib>
#define _ ios::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{
int a,b,c,d,x,y,g;
char k;
while(cin>>a>>b>>c>>d>>k)
{
if(k=='+')
{
x=a*d+b*c;
y=b*d;
g=__gcd(x,y);
x/=g;
y/=g;
if(x==0)
cout<<0<<endl;
else if(y==1)
cout<<x<<endl;
else if(x<0&&y<0)
cout<<-x<<"/"<<-y<<endl;
else
cout<<x<<"/"<<y<<endl;
}
else if(k=='-')
{
x=a*d-b*c;
y=b*d;
g=__gcd(x,y);
x/=g;
y/=g;
if(x==0)
cout<<0<<endl;
else if(y==1)
cout<<x<<endl;
else if(x<0&&y<0)
cout<<-x<<"/"<<-y<<endl;
else
cout<<x<<"/"<<y<<endl;
}
else if(k=='*')
{
x=a*c;
y=b*d;
g=__gcd(x,y);
x/=g;
y/=g;
if(x==0)
cout<<0<<endl;
else if(y==1)
cout<<x<<endl;
else if(x<0&&y<0)
cout<<-x<<"/"<<-y<<endl;
else
cout<<x<<"/"<<y<<endl;
}
else if(k=='/')
{
x=a*d;
y=b*c;
g=__gcd(x,y);
x/=g;
y/=g;
if(x==0)
cout<<0<<endl;
else if(y==1)
cout<<x<<endl;
else if(x<0&&y<0)
cout<<-x<<"/"<<-y<<endl;
else
cout<<x<<"/"<<y<<endl;
}
}
}