print((function (h, m, td, ctd) local t = (h+td-ctd)*60 + m return string.format("%02d:%02d", math.floor(t/60)%24, t%60) end)(io.stdin:read("*n"), io.stdin:read("*n"), tonumber(io.stdin:read("*l"):sub(5)), 9))