Var a, b, c, d, Num, Denom, Divis: Integer;
Function gcd(a, b: Integer): Integer;
Var Temp: Integer;
Begin
While b > 0 Do
Begin
Temp := b;
b := a mod b;
a := Temp
End;
gcd := a;
End;
Begin
WriteLn('Введите числа A, B, C, D: ');
Read(a, b, c, d);
Num := a * d;
Denom := b * c;
Divis := gcd(Num, Denom);
WriteLn(Num div Divis, '/', Denom div Divis);
End.