require "time"
t0 = Time.strptime("0 0 0", "%H %M %S")
t1 = Time.strptime("2 0 0", "%H %M %S")
loop do
   break if gets =~ /^-1/
   t = Time.strptime($_, "%H %M %S")
   puts (t0 + (t1 - t)).strftime("%H:%M:%S")
   puts (t0 + 3 * (t1 - t)).strftime("%H:%M:%S")
end