var a,b:array[0..7,1..2]of real;
i,j,tot:longint;
h,x0,l,r,m,ans:real;
functionf(a,b:real):real;
beginexit(sqrt(a*a-b*b));
end;
functionpan:boolean;
var i,j,l:longint;
bool:boolean;
beginif tot=0thenexit(false);
if b[1,1]>0thenexit(false);
bool:=true;
for i:=tot downto1doif b[i,2]>=x0 thenbegin
bool:=false;
break;
end;
if bool thenexit(false);
l:=1;
for i:=1to tot dobeginif i>l thenexit(false);
for j:=i+1to tot doif b[i,2]>=b[j,1] thenbeginif j>l then l:=j;
if l=tot thenexit(true);
end;
end;
exit(true);
end;
beginread(h,x0);
l:=0; r:=x0; ans:=x0;
for i:=1to7doread(a[i,1],a[i,2]);
while l<r dobegin
m:=trunc((l+r)*5000)/10000;
tot:=0;
for i:=1to7doif a[i,2]+m>=h thenbegin
inc(tot);
b[tot,1]:=a[i,1]-f(a[i,2]+m,h);
b[tot,2]:=a[i,1]+f(a[i,2]+m,h);
end;
for i:=1to tot-1dofor j:=i+1to tot doif b[i,1]>b[j,1] thenbegin
b[0]:=b[i];
b[i]:=b[j];
b[j]:=b[0];
end;
for i:=1to tot doif b[i,1]>x0 then break;
tot:=i-1;
if pan thenbegin
r:=m-0.001;
ans:=m;
endelse
l:=m+0.001;
end;
writeln(ans:0:2);
end.