#!/usr/bin/python
import sys

def compute(prey, otherHunter, dist):
	if prey[1] != 0:
		temp0 = prey[1] / prey[1]
	else:
		temp0 = prey[1]
	temp1 = max( otherHunter[0] , dist )
	if temp1 > otherHunter[0] :
		temp1 = -1 * prey[0]
	else:
		temp1 = prey[1] + prey[1]
	temp0 = min( prey[1] , temp0 )
	if otherHunter[0] != 0:
		temp0 = temp1 / otherHunter[0]
	else:
		temp0 = otherHunter[0]
	temp0 = prey[0] - prey[1]
	temp1 = temp0 * otherHunter[0]
	temp0 = otherHunter[1] - prey[1]
	if prey[1] > temp1 :
		temp2 = max( dist , prey[0] )
	else:
		temp2 = otherHunter[1] * otherHunter[0]
	temp1 = prey[0] + temp2
	temp3 = max( prey[1] , temp1 )
	if otherHunter[1] > temp1 :
		temp4 = max( dist , dist )
	else:
		if prey[1] > temp3 :
			temp4 = otherHunter[1] - otherHunter[0]
		else:
			if temp2 != 0:
				temp4 = prey[1] / temp2
			else:
				temp4 = temp2
	temp5 = -1 * prey[1]
	temp2 = temp5 - otherHunter[1]
	temp2 = temp3 + temp2
	temp0 = min( prey[1] , dist )
	temp6 = max( temp4 , temp0 )
	temp4 = min( dist , dist )
	temp6 = prey[0] - prey[1]
	if prey[1] != 0:
		temp4 = temp3 / prey[1]
	else:
		temp4 = prey[1]
	temp1 = prey[0] + temp4
	temp5 = max( temp3 , temp3 )
	return [ temp2 , otherHunter[1] ]
