uses crt;
var a,b,ts,ms:integer;
{--------------------------chuong-trinh-con------------------}
function ucln(var x,y:integer):integer;
var i,j:integer;
begin
clrscr;
if x>y then
begin
ucln:=1;
for i:=1 to y do
if (x mod i=0) and (y mod i=0) then
begin
if ucln<i then ucln:=i;
end;
end
else begin
ucln:=1;
for j:=1 to x do
if (x mod j=0) and (y mod j=0) then
begin
if ucln<j then ucln:=j;
end;
end;
end;
{------------------------chuong-trinh-chinh-------------------}
begin
clrscr;
write('nhap a='); readln(a);
write('nhap b='); readln(b);
ts:=a div ucln(a,b);
ms:=b div ucln(a,b);
writeln('Phan so sau khi rut gon la: ',ts,'/',ms);
readln;
end.