So, the Berland is at war with its eternal enemy Flatland again, and Vasya, an accountant, was assigned to fulfil his duty to the nation. 

Right now the situation in Berland is dismal — their both cities are surrounded! The armies of flatlanders stand on the borders of circles, the circles' centers are in the surrounded cities. At any moment all points of the flatland ring can begin to move quickly in the direction of the city — that's the strategy the flatlanders usually follow when they besiege cities.

The berlanders are sure that they can repel the enemy's attack if they learn the exact time the attack starts. For that they need to construct a radar that would register any movement at the distance of at most r from it. Thus, we can install a radar at such point, that at least one point of the enemy ring will be in its detecting range (that is, at a distance of at most r). Then the radar can immediately inform about the enemy's attack. 

Due to the newest technologies, we can place a radar at any point without any problems. But the problem is that the berlanders have the time to make only one radar. Besides, the larger the detection radius (r) is, the more the radar costs.

That's why Vasya's task (that is, your task) is to find the minimum possible detection radius for the radar. In other words, your task is to find the minimum radius r (r ≥ 0) such, that a radar with radius r can be installed at some point and it can register the start of the movements of both flatland rings from that point. 

In this problem you can consider the cities as material points, the attacking enemy rings - as circles with centers in the cities, the radar's detection range — as a disk (including the border) with the center at the point where the radar is placed.

Input

The input files consist of two lines. Each line represents the city and the flatland ring that surrounds it as three space-separated integers xi, yi, ri (|xi|, |yi| ≤ 104; 1 ≤ ri ≤ 104) — the city's coordinates and the distance from the city to the flatlanders, correspondingly.

It is guaranteed that the cities are located at different points.

Output

Print a single real number — the minimum detection radius of the described radar. The answer is considered correct if the absolute or relative error does not exceed 10 - 6.

Examples

Input

0 0 1
6 0 3


Output

1.000000000000000

Input

-10 10 3
10 -10 3


Output

11.142135623730951

Note

The figure below shows the answer to the first sample. In this sample the best decision is to put the radar at point with coordinates (2, 0). 

<image>

The figure below shows the answer for the second sample. In this sample the best decision is to put the radar at point with coordinates (0, 0). 

<image>

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Geometry


Solutions:
import sys
import math
(a, b, c) = map(int, sys.stdin.readline().split())
(d, e, f) = map(int, sys.stdin.readline().split())
ds = math.sqrt((a - d) ** 2 + (b - e) ** 2)
if ds >= c + f:
	print((ds - c - f) / 2)
elif ds <= abs(c - f):
	print((abs(c - f) - ds) / 2)
else:
	print(0)


a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
cities = ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** 0.5
if a[2] + b[2] > cities:
	if a[2] > b[2] + cities:
		print((a[2] - (b[2] + cities)) / 2)
	elif b[2] > a[2] + cities:
		print((b[2] - a[2] - cities) / 2)
	else:
		print(0.0)
else:
	print((cities - a[2] - b[2]) / 2)


import math
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
d = (x2 - x1) ** 2 + (y2 - y1) ** 2
ans = 0.0
if d >= (r1 + r2) ** 2:
	ans = math.sqrt(d) - r1 - r2
elif d >= (r1 - r2) ** 2:
	ans = 0.0
else:
	ans = abs(r1 - r2) - math.sqrt(d)
ans /= 2
print(ans)


import sys
import math
from heapq import *
input = sys.stdin.readline
from functools import cmp_to_key

def pi():
	return int(input())

def pl():
	return int(input(), 16)

def ti():
	return list(map(int, input().split()))

def ts():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
mod = 1000000007
f = []

def fact(n, m):
	global f
	f = [1 for i in range(n + 1)]
	f[0] = 1
	for i in range(1, n + 1):
		f[i] = f[i - 1] * i % m

def fast_mod_exp(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b = b >> 1
	return res

def inverseMod(n, m):
	return fast_mod_exp(n, m - 2, m)

def ncr(n, r, m):
	if n < 0 or r < 0 or r > n:
		return 0
	if r == 0:
		return 1
	return f[n] * inverseMod(f[n - r], m) % m * inverseMod(f[r], m) % m

def main():
	B()

def B():
	[x1, y1, r1] = ti()
	[x2, y2, r2] = ti()
	d = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
	x = (d - r1 - r2) / 2
	y = (max(r1, r2) - d - min(r1, r2)) / 2
	print(x if x >= 0 else y if y >= 0 else 0.0)
main()


f = lambda : map(int, input().split())
(x1, y1, r1) = f()
(x2, y2, r2) = f()
if r2 > r1:
	(r1, r2) = (r2, r1)
d = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
x = min(abs(d - r1 - r2), abs(d - r1 - r2 + 2 * r2))
print(0 if abs(r1 - d) <= r2 else x / 2)


from math import pow
(n, m, r) = map(int, input().split())
(n1, m1, r1) = map(int, input().split())
dis = pow(pow(n1 - n, 2) + pow(m - m1, 2), 1 / 2)
if abs(r1 - r) <= dis <= abs(r1 + r):
	rad = 0
elif dis < r1 + r:
	if r1 > r:
		rad = r1 - dis - r
	else:
		rad = r - dis - r1
else:
	rad = dis - (r + r1)
print(rad / 2)


import os, sys
from io import IOBase, BytesIO
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log, pi, sin
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outarr(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def distance():
	return sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
(x1, y1, r1) = sp()
(x2, y2, r2) = sp()
dist = distance()
radius: float = dist - r1 - r2
if radius < 0:
	radius = -radius
	radius /= 2
	radius -= min(r1, r2)
else:
	radius /= 2
out(max(0.0, radius))


from math import *
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
dist = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
dist -= r1 + r2
if dist >= 0:
	print(dist / 2)
else:
	dist += r1 + r2
	x = (max(r1, r2) - dist - min(r1, r2)) / 2
	print(max(x, 0))


from math import sqrt

def circle(x1, y1, x2, y2, r1, r2):
	(dist, r, minimum) = (sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), r1 + r2, 0)
	if dist > r:
		minimum = dist - r
	elif dist < abs(r1 - r2):
		minimum = abs(r1 - r2) - dist
	return '{0:.15f}'.format(minimum / 2)
(X1, Y1, R1) = [int(i) for i in input().split()]
(X2, Y2, R2) = [int(i) for i in input().split()]
print(circle(X1, Y1, X2, Y2, R1, R2))


from math import sqrt
(x_1, y_1, r_1) = map(int, input().split())
(x_2, y_2, r_2) = map(int, input().split())
d = sqrt((x_1 - x_2) ** 2 + (y_1 - y_2) ** 2)
if d + r_2 < r_1:
	print((r_1 - d - r_2) / 2)
elif d + r_1 < r_2:
	print((r_2 - d - r_1) / 2)
elif d <= r_1 + r_2:
	print(0)
else:
	print((d - r_1 - r_2) / 2)


(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
sq = lambda x: x * x
dis = (sq(x1 - x2) + sq(y1 - y2)) ** 0.5

def solve(L, r1, r2):
	if r1 < r2:
		(r1, r2) = (r2, r1)
	if L >= r1 + r2:
		return L - r1 - r2
	elif L <= r1 - r2:
		return r1 - L - r2
	else:
		return 0
print(solve(dis, r1, r2) / 2)


import math
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
d = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
R = max(r1, r2)
r = min(r1, r2)
if R - r == d or R + r == d or (R + r > d and R - r < d):
	print('{0:.15f}'.format(0))
else:
	a = []
	m = (y2 - y1) / (x2 - x1)
	c = x1 + r1 / math.sqrt(m ** 2 + 1)
	d = y1 + r1 * m / math.sqrt(m ** 2 + 1)
	a.append([c, d])
	c = x1 - r1 / math.sqrt(m ** 2 + 1)
	d = y1 - r1 * m / math.sqrt(m ** 2 + 1)
	a.append([c, d])
	b = []
	c = x2 + r2 / math.sqrt(m ** 2 + 1)
	d = y2 + r2 * m / math.sqrt(m ** 2 + 1)
	b.append([c, d])
	c = x2 - r2 / math.sqrt(m ** 2 + 1)
	d = y2 - r2 * m / math.sqrt(m ** 2 + 1)
	b.append([c, d])
	dis = 10 ** 10
	for i in a:
		for j in b:
			dis = min(dis, math.sqrt((i[0] - j[0]) ** 2 + (i[1] - j[1]) ** 2))
	print('{0:.15f}'.format(dis / 2))


from math import sqrt
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
if r1 < r2:
	(x1, x2) = (x2, x1)
	(y1, y2) = (y2, y1)
	(r1, r2) = (r2, r1)
dist = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
if dist > r1 + r2:
	ans = (dist - r1 - r2) / 2
elif r1 - r2 > dist:
	ans = (r1 - r2 - dist) / 2
else:
	ans = 0.0
print('%.15f' % ans)


import math
(x1, y1, r1) = map(int, input().split(' '))
(x2, y2, r2) = map(int, input().split(' '))
s = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
rm = max(r1, r2)
if rm != r1:
	r2 = r1
	r1 = rm
if s >= r1 + r2:
	ans = s - r2 - r1
	ans = ans / 2
elif r1 - s >= r2:
	ans = r1 - r2 - s
	ans = ans / 2
else:
	ans = 0
print(ans)


from math import sqrt
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
d = (x1 - x2) ** 2 + (y1 - y2) ** 2
d = sqrt(d)
if d > r1 + r2:
	print((d - r1 - r2) / 2)
elif abs(r1 - r2) <= d <= r1 + r2:
	print(0)
else:
	print((max(r1, r2) - (d + min(r1, r2))) / 2)


from math import hypot
(x1, y1, r1) = map(float, input().split())
(x2, y2, r2) = map(float, input().split())
d = hypot(x1 - x2, y1 - y2)
if d < abs(r1 - r2):
	d = abs(r1 - r2) - d
else:
	d = max(0, d - r1 - r2)
print(d / 2)


import math
import sys
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
t = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)
if t <= (r1 - r2) * (r1 - r2):
	print((abs(r1 - r2) - math.sqrt(t)) / 2)
elif t <= (r1 + r2) * (r1 + r2):
	print(0)
else:
	print((math.sqrt(t) - r1 - r2) / 2)


(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
d = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
if d > r1 + r2:
	print(abs(r1 + r2 - d) / 2)
elif d < abs(r1 - r2):
	print((abs(r1 - r2) - d) / 2)
else:
	print(0)


from math import sqrt
(x1, y1, r1) = map(int, input().split())
(x2, y2, r2) = map(int, input().split())
disc = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
if r1 < r2:
	(x1, y1, r1, x2, y2, r2) = (x2, y2, r2, x1, y1, r1)
if r1 + r2 < disc:
	print((disc - (r1 + r2)) / 2)
elif disc + r2 < r1:
	print((r1 - disc - r2) / 2)
else:
	print(0)


import math
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
d = math.sqrt((a1[0] - a2[0]) ** 2 + (a1[1] - a2[1]) ** 2)
r = min(a1[2], a2[2])
R = max(a1[2], a2[2])
if d + r < R or d + r == R:
	print((R - d - r) / 2)
elif d < r + R or d == r + R:
	print('0')
else:
	print((d - a1[2] - a2[2]) / 2)


(a, b, c) = map(int, input().split(' '))
(d, e, f) = map(int, input().split(' '))
dist = (abs(a - d) ** 2 + abs(b - e) ** 2) ** 0.5
maxx = max(c, f)
minn = min(c, f)
if maxx > minn + dist:
	print((maxx - minn - dist) / 2)
else:
	print(max(0, (dist - c - f) / 2))


import math
(x1, y1, r1) = [int(x) for x in input().split()]
(x2, y2, r2) = [int(x) for x in input().split()]
dist = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
(min1, max1) = (-r1, r1)
(min2, max2) = (dist - r2, dist + r2)
if max1 < min2:
	print((min2 - max1) / 2)
elif (min1 <= min2) ^ (max2 <= max1):
	print(0)
else:
	print(min(abs(min2 - min1), abs(max1 - max2)) / 2)


def distance(x1, y1, x2, y2):
	return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
(x1, y1, r1) = [int(i) for i in input().split()]
(x2, y2, r2) = [int(i) for i in input().split()]
dista = distance(x1, y1, x2, y2)
if dista >= r1 + r2:
	print((dista - r1 - r2) / 2)
else:
	p = (max(r1, r2) - min(r1, r2) - dista) / 2
	if p < 0:
		print(0)
	else:
		print(p)


(a, b, c) = map(int, input().split())
(d, e, f) = map(int, input().split())
r = ((a - d) ** 2 + (b - e) ** 2) ** 0.5
if r >= c + f:
	print((r - c - f) / 2)
elif r <= abs(c - f):
	print((abs(c - f) - r) / 2)
else:
	print(0)


a = list(map(int, input().split()))
b = list(map(int, input().split()))
import math
d = abs(a[0] - b[0]) ** 2 + abs(a[1] - b[1]) ** 2
if d >= (a[2] + b[2]) ** 2:
	print((math.sqrt(d) - a[2] - b[2]) / 2)
	quit()
d = math.sqrt(d)
print(max(max(a[2], b[2]) - d - min(a[2], b[2]), 0) / 2)


(x1, y1, r1) = list(map(float, input().split()))
(x2, y2, r2) = list(map(float, input().split()))
if r1 > r2:
	(r2, r1) = (r1, r2)
d = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
if d > r1 + r2:
	print((d - (r1 + r2)) / 2)
elif r2 > d + r1:
	print((r2 - (r1 + d)) / 2)
else:
	print(0)


from sys import stdin, stdout
from decimal import Decimal
(x1, y1, r1) = map(Decimal, stdin.readline().split())
(x2, y2, r2) = map(Decimal, stdin.readline().split())

def distance(x1, y1, x2, y2):
	return ((x1 - x2) ** Decimal(2) + (y1 - y2) ** Decimal(2)) ** Decimal(0.5)
if distance(x1, y1, x2, y2) >= r1 + r2:
	stdout.write(str((distance(x1, y1, x2, y2) - r1 - r2) / 2))
elif min(r1, r2) - max(r1, r2) + distance(x1, y1, x2, y2) < 0:
	d1 = max(r1, r2) - min(r1, r2) - distance(x1, y1, x2, y2)
	d2 = max(r1, r2) - 2 * min(r1, r2) - d1 + max(r1, r2)
	stdout.write(str(min(d1, d2) / 2))
else:
	stdout.write('0')


import sys
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
(x1, y1, r1) = rinput()
(x2, y2, r2) = rinput()
d = math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) - r1 - r2
r = d / 2
f = -(r + min(r1, r2))
if r >= 0:
	print(r)
elif f >= 0:
	print(f)
else:
	print(0)


from math import sqrt
(x1, y1, r1) = [int(x) for x in input().split()]
(x2, y2, r2) = [int(x) for x in input().split()]
diff = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) / 2
l = [diff, r1 / 2, r2 / 2]
l.sort()
print(max(0, l[2] - l[1] - l[0]))


def dista(x1, y1, x2, y2):
	dist = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
	return dist
(x1, y1, r1) = [int(i) for i in input().split()]
(x2, y2, r2) = [int(i) for i in input().split()]
if dista(x1, y1, x2, y2) + min(r1, r2) <= max(r1, r2):
	ans = max(r1, r2) - dista(x1, y1, x2, y2) - min(r1, r2)
	ans1 = max(r1, r2) - min(r1, r2)
	ans /= 2
	ans1 /= 2
	print(min(ans, ans1))
else:
	ans = dista(x1, y1, x2, y2) - r1 - r2
	ans /= 2
	if ans > 0:
		print(ans)
	else:
		print(0)


from math import sqrt
(a, b) = (list(map(int, input().split())), list(map(int, input().split())))
d = sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
(a, b) = (a[2], b[2])
if d >= a + b:
	print((d - a - b) / 2)
else:
	if a > b:
		(a, b) = (b, a)
	print(max(0, (b - d - a) / 2))


from math import sqrt

def around(x1, y1, r1, x2, y2, r2):
	r = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
	if r >= r1 + r2:
		return '{:6f}'.format((r - r1 - r2) / 2)
	elif r <= abs(r1 - r2):
		return '{:6f}'.format((abs(r1 - r2) - r) / 2)
	return 0
(X1, Y1, R1) = [int(i) for i in input().split()]
(X2, Y2, R2) = [int(i) for i in input().split()]
print(around(X1, Y1, R1, X2, Y2, R2))


import math
city1 = list(map(int, input().split()))
city2 = list(map(int, input().split()))
x = max(city1[0], city2[0]) - min(city1[0], city2[0])
y = max(city1[1], city2[1]) - min(city1[1], city2[1])
R = max(city1[2], city2[2])
r = min(city1[2], city2[2])
c = math.sqrt(x ** 2 + y ** 2)
if R > r + c:
	print(max((c - r) / 2, (R - c - r) / 2))
else:
	ans = (c - (city1[2] + city2[2])) / 2
	if ans < 0:
		print(0)
	else:
		print(ans)