import java.util.*;
public class Main {
public static void main
(String[] args
) { Scanner input
=new Scanner
(System.
in); int xa=input.nextInt();
int ya=input.nextInt();
int ua=input.nextInt();
int la=input.nextInt();
int xb=input.nextInt();
int yb=input.nextInt();
int ub=input.nextInt();
int lb=input.nextInt();
int pointx=xb;
int pointy=ya;
double t1a,t2a,t1b,t2b;
if(ua==0)
{
t1a=0;
}
else
{
t1a=(double)(pointx-xa)/ua;
t2a=(double)(pointx-(xa+la))/ua;
}
if(ub==0)
{
t1b=0;
}
else
{
t1b=(double)(pointy-yb)/ub;
t2b=(double)(pointy-(yb+lb))/ub;
}
if((t1a<0 && t2a<0) || (t1b<0 && t2b<0))
{
return;
}
if(t1a<0)
{
t1a=0;
}
if(t2a<0)
{
t2a=0;
}
if(t1b<0)
{
t1b=0;
}
if(t2b<0)
{
t2b=0;
}
double firsta,firstb,seconda,secondb;
if(t1a<t2a)
{
firsta=t1a;
seconda=t2a;
}
else
{
firsta=t2a;
seconda=t1a;
}
if(t1b<t2b)
{
firstb=t1b;
secondb=t2b;
}
else
{
firstb=t2b;
secondb=t1b;
}
System.
out.
println(Math.
min(seconda,secondb
)-Math.
max(firsta,firstb
)); if(Math.
min(seconda,secondb
)-Math.
max(firsta,firstb
)>0.000001) {
}
else
{
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwpwdWJsaWMgY2xhc3MgTWFpbiB7CgoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBTY2FubmVyIGlucHV0PW5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAgICAgaW50IHhhPWlucHV0Lm5leHRJbnQoKTsKICAgICAgICBpbnQgeWE9aW5wdXQubmV4dEludCgpOwogICAgICAgIGludCB1YT1pbnB1dC5uZXh0SW50KCk7CiAgICAgICAgaW50IGxhPWlucHV0Lm5leHRJbnQoKTsKICAgICAgICBpbnQgeGI9aW5wdXQubmV4dEludCgpOwogICAgICAgIGludCB5Yj1pbnB1dC5uZXh0SW50KCk7CiAgICAgICAgaW50IHViPWlucHV0Lm5leHRJbnQoKTsKICAgICAgICBpbnQgbGI9aW5wdXQubmV4dEludCgpOwoKICAgICAgICBpbnQgcG9pbnR4PXhiOwogICAgICAgIGludCBwb2ludHk9eWE7CiAgICAgICAgZG91YmxlIHQxYSx0MmEsdDFiLHQyYjsKICAgICAgICBpZih1YT09MCkKICAgICAgICB7CiAgICAgICAgICAgIHQxYT0wOwogICAgICAgICAgICB0MmE9RG91YmxlLk1BWF9WQUxVRTsKCiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIHQxYT0oZG91YmxlKShwb2ludHgteGEpL3VhOwogICAgICAgICAgICB0MmE9KGRvdWJsZSkocG9pbnR4LSh4YStsYSkpL3VhOwogICAgICAgIH0KCiAgICAgICAgaWYodWI9PTApCiAgICAgICAgewogICAgICAgICAgICB0MWI9MDsKICAgICAgICAgICAgdDJiPURvdWJsZS5NQVhfVkFMVUU7CgogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICB0MWI9KGRvdWJsZSkocG9pbnR5LXliKS91YjsKICAgICAgICAgICAgdDJiPShkb3VibGUpKHBvaW50eS0oeWIrbGIpKS91YjsKICAgICAgICB9CiAgICAgICAgaWYoKHQxYTwwICYmIHQyYTwwKSB8fCAodDFiPDAgJiYgdDJiPDApKQogICAgICAgIHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJubyIpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGlmKHQxYTwwKQogICAgICAgIHsKICAgICAgICAgICAgdDFhPTA7CiAgICAgICAgfQogICAgICAgIGlmKHQyYTwwKQogICAgICAgIHsKICAgICAgICAgICAgdDJhPTA7CiAgICAgICAgfQogICAgICAgIGlmKHQxYjwwKQogICAgICAgIHsKICAgICAgICAgICAgdDFiPTA7CiAgICAgICAgfQogICAgICAgIGlmKHQyYjwwKQogICAgICAgIHsKICAgICAgICAgICAgdDJiPTA7CiAgICAgICAgfQogICAgICAgIGRvdWJsZSBmaXJzdGEsZmlyc3RiLHNlY29uZGEsc2Vjb25kYjsKICAgICAgICBpZih0MWE8dDJhKQogICAgICAgIHsKICAgICAgICAgICAgZmlyc3RhPXQxYTsKICAgICAgICAgICAgc2Vjb25kYT10MmE7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGZpcnN0YT10MmE7CiAgICAgICAgICAgIHNlY29uZGE9dDFhOyAgICAgICAgIAogICAgICAgIH0KICAgICAgICBpZih0MWI8dDJiKQogICAgICAgIHsKICAgICAgICAgICAgZmlyc3RiPXQxYjsKICAgICAgICAgICAgc2Vjb25kYj10MmI7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGZpcnN0Yj10MmI7CiAgICAgICAgICAgIHNlY29uZGI9dDFiOyAgICAgICAKICAgICAgICB9CgkJU3lzdGVtLm91dC5wcmludGxuKE1hdGgubWluKHNlY29uZGEsc2Vjb25kYiktTWF0aC5tYXgoZmlyc3RhLGZpcnN0YikpOwogICAgICAgIGlmKE1hdGgubWluKHNlY29uZGEsc2Vjb25kYiktTWF0aC5tYXgoZmlyc3RhLGZpcnN0Yik+MC4wMDAwMDEpCiAgICAgICAgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oInllcyIpOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIm5vIik7CiAgICAgICAgfQoKICAgIH0KfQ==