from math import sqrt C0,C1,C2,C3=map(int,input().split()) L,R=map(int,input().split()) def f(x): return C0+C1*x+C2*x**2+C3*x**3 def absf(x): return abs(C0+C1*x+C2*x**2+C3*x**3) if C3!=0: if C2**2-3*C1*C3>=0: #print(C2**2-3*C1*C3) X1=(-C2+sqrt(C2**2-3*C1*C3))/3/C3 X2=(-C2-sqrt(C2**2-3*C1*C3))/3/C3 X=[] #print(X1,X2) if L0 and f(R)>0 and f(x)>0) or (f(L)<0 and f(R)<0 and f(x)<0) : continue else: flag=False if flag: ans=min(absf(L),absf(R)) for x in X: ans=min(ans,absf(x)) print(ans) exit() else: print(0) exit() else: flag=False #print(f(L),f(R)) if (f(L)>0 and f(R)>0) or (f(L)<0 and f(R)<0): flag=True if flag: ans=min(absf(L),absf(R)) print(ans) exit() else: print(0) exit() else: if C2!=0: ans=min(absf(L),absf(R)) X=-C1/2/C2 if L<=X<=R: ans=min(ans,absf(X)) else: if C1!=0: ans=min(absf(L),absf(R)) else: ans=0 print(ans)