require 'scanf' a,b,g = gets.chomp.scanf('%02d %02d UTC%f') t0 = a * 60 + b - 9 * 60 h,m = (t0 + (60 * g).to_i).divmod(60) puts [h % 24, m].map{|hm| '%02d' % hm }.join(':')