a,b,c,d=map(int,input().split()) L,R=map(int,input().split()) def f(x): return a+b*x+c*x*x+d*x*x*x mi=min(f(L),f(R)) ma=max(f(L),f(R)) eps=1e-7 if d: if c*c-3*b*d>=0: D=c*c-3*b*d for i in ((-c+D**.5)/(3*d),(-c-D**.5)/(3*d)): if L-eps<=i<=R+eps: mi=min(mi,f(i)) ma=min(ma,f(i)) else: if c: i=(-b)/(2*c) if L-eps<=i<=R+eps: mi=min(mi,f(i)) ma=min(ma,f(i)) if mi