program Tong_Phan_So;
var
tu_so1, mau_so1, tu_so2, mau_so2, tu_so_tong, mau_so_tong, ucln: integer;
begin
write('Nhap tu so phan so 1: ');
readln(tu_so1);
write('Nhap mau so phan so 1: ');
readln(mau_so1);
write('Nhap tu so phan so 2: ');
readln(tu_so2);
write('Nhap mau so phan so 2: ');
readln(mau_so2);
tu_so_tong := tu_so1 * mau_so2 + tu_so2 * mau_so1;
mau_so_tong := mau_so1 * mau_so2;
ucln := gcd(tu_so_tong, mau_so_tong);
tu_so_tong := tu_so_tong div ucln;
mau_so_tong := mau_so_tong div ucln;
writeln('Tong hai phan so la: ', tu_so_tong, '/', mau_so_tong);
end.