Var
a, b: integer;
function greatest_common_divisor(m, n: integer): integer;
var
modulo: integer;
begin
modulo := m mod n;
if modulo = 0 then
greatest_common_divisor := n
else
greatest_common_divisor := greatest_common_divisor(n, modulo)
end;
procedure reduce_the_fraction(a, b: integer);
var
gcd: integer;
sign: string;
begin
gcd := greatest_common_divisor(a, b);
if a * b < 0 then
sign := '-';
writeln(sign, abs(a) / gcd, '/', abs(b) / gcd);
end;
begin
write('Enter two numbers: ');
readln(a, b);
reduce_the_fraction(a, b);
end.