#include <iostream>
using namespace std;
struct Fractie {int a,b;} x,y,S,P,D,C;
int cmmdc(int a, int b)
{
while (b)
{
int r=a%b;
a=b;
b=r;
}
return a;
}
int main()
{
int CMMDC;
cin>>x.a>>x.b>>y.a>>y.b;
S.a=x.a*y.b+y.a*x.b;
S.b=x.b*y.b;
CMMDC= cmmdc (S.a, S.b);
S.a=S.a/CMMDC;
S.b=S.b/CMMDC;
cout<<"S="<<S.a<<"/"<<S.b<<endl;
//...analog se continua pentru P,D,C ...
return 0;
}