S = gets.chomp a,b,g = [S[0,2].to_i, S[3,2].to_i, S[9 ... S.size].to_f] t0 = a * 60 + b - 9 * 60 h,m = (t0 + (60 * g).round).divmod(60) puts [h % 24, m].map{|hm| '%02d' % hm }.join(':')