output
dòng 1 là cộng
dòng 2 là trừ
dòng 3 là nhân
dòng 4 là chia
const fi='phanso.inp';
fo='phanso.out';
var tg,dk,bk,a,b,c,d:longint; mau,tu:array[1..4]of longint;
procedure doc;
begin
assign(input,fi);
reset(input);
readln(a,b);
readln(c,d);
close(input);
end;
function ucln(x,y:longint):longint;
begin
if x mod y=0 then exit(y);
if y mod x=0 then exit(x);
repeat
if x>y then
begin
x:=x mod y;
y:=x div y;
end;
if y>x then
begin
y:=y mod x;
x:=y div x;
end;
until (x=0)or (y=0);
if x<>0 then exit(x) else exit(y);
end;
procedure inkq;
var i:longint;
begin
assign(output,fo);
rewrite(output); writeln(bk,' ',dk);writeln(tg);
for i:=1 to 4 do
writeln(tu, '/' ,mau);writeln(ucln(b,d));
close(output);
end;
procedure xuli;
var i:longint;
begin
tg:=ucln(b,d);
bk:=b div tg; dk:=d div tg;
mau[1]:=bk*tg*dk;
tu[1]:=a*dk+c*bk;
mau[2]:=mau[1];
tu[2]:=a*dk-c*bk;
mau[3]:=b*d;
tu[3]:=a*c;
mau[4]:=b*c;
tu[4]:=a*d;
for i:=1 to 4 do
begin
tg:=ucln(mau,tu);
mau:=mau div tg;
tu:=tu div tg;
end;
end;
begin
doc;
xuli;
inkq;
end.