h, m = gets.chomp.split(':').map(&:to_i) dest = (60 * h + m + 5) % 1440 puts "#{dest / 60}:#{dest % 60}"