a,b,c,d,p,q=map(int,input().split()) def f(x): return a*x**3+b*x**2+c*x+d xmin,xmax=p,q if (b**2-3*a*c)>0 and a!=0: xmin=round(min((-b+(b**2-3*a*c)**0.5)/3/a,(-b-(b**2-3*a*c)**0.5)/3/a)) xmax=round(max((-b+(b**2-3*a*c)**0.5)/3/a,(-b-(b**2-3*a*c)**0.5)/3/a)) xmin=xmin if pxmin else p xmax=xmax if pxmax else q mx=xmin if f(xmin)f(x) else mx MX=x if f(xmax)