hh,mm = gets.split(':').map(&:to_i) t = 60 * hh + mm + 5 h, m = t.divmod(60) h = 0 if h == 24 puts "%02d:%02d" % [h, m]