#include <bits/stdc++.h>
using namespace std;
int lcm(int b,int d){
int n = b*d/__gcd(b, d); //最小公倍數
return n;
}
int main()
{
int a, b, c, d, n, m; //n=分子;m=分母
char x; //運算子
while (cin >> a >> b >> c >> d >> x){
if (x=='+'){
n = (lcm(b, d)/b)*a + (lcm(b, d)/d)*c;
m = lcm(b, d);
}
else if (x=='-'){
n = (lcm(b, d)/b)*a - (lcm(b, d)/d)*c;
m = lcm(b, d);
}
else if (x=='*'){
n = a*c;
m = b*d;
}
else if (x=='/'){
n = a*d;
m = b*c;
}
if (n%m==0){ //整數判斷
cout << n/m << '\n';
}
else {
if (m/__gcd(n, m)<0){ //分母是負數就變號再輸出
cout << -n/__gcd(n, m) << '/' << -m/__gcd(n, m) << '\n';
}
else {
cout << n/__gcd(n, m) << '/' << m/__gcd(n, m) << '\n';
}
}
}
return 0;
}