#include
using namespace std;
class Fen{
int zi;
int zm;
public:
Fen(int m=0,int n=1){zi=m;zm=n;}
void dao(){cout<<"倒数是:"<<zm<<"/"<<zi<<endl;}//倒数
Fen operator+(Fen q){
Fen sum;
if(zm==q.zm){
sum.zm=zm;
sum.zi=q.zi+zi;
}
else if(zm!=q.zm)
{
sum.zm=zmq.zm;
sum.zi=q.zizm+ziq.zm;
}
return sum;
}//加法
Fen operator-(Fen q){
Fen ca;
if(zm==q.zm){
ca.zm=zm;
ca.zi=zi-q.zi;
}
else if(zm!=q.zm)
{
ca.zm=zmq.zm;
ca.zi=ziq.zm-q.zi*zm;
}
return ca;
}//减法
int operator>(Fen q){
if(zm==q.zm)
{
if(zi>q.zi) return 1;
}
if(zm!=q.zm)
{
if(ziq.zm>q.zi*zm) return 1;
}
return 0;
}//比较大小
void show(){
int t,u,r;
t=zi;
u=zm;
if(zi==0) cout<<'0'<<endl;
if(zi>=zm)
{
if(zi%zm==0){cout<<(zi/zm)<<endl;}
if(zi%zm!=0)
{
while(zi%zm!=0)
{
r=zm;
zm=zi%zm;
zi=r;
}
cout<<(t/zm)<<"/"<<(u/zm)<<endl;
}
}
if(zi<zm)
{
if(zm%zi==0){cout<<"1"<<"/"<<(zm/zi)<<endl;}
if(zm%zi!=0)
{
while(zm%zi!=0)
{
r=zi;
zi=zm%zi;
zm=r;
}
cout<<(t/zi)<<"/"<<(u/zi)<<endl;
}
}
}
};
int main(){
int n,m,c,d;
cin>>n>>m>>c>>d;
Fen a(n,m),b(c,d),s,ca;
a.dao();
a.show();
s=a+b;
s.show();
ca=a-b;
ca.show();
cout<<(a>b)<<endl;
return 0;
}