a,b,c,d,p,q=map(int,input().split()) v=[((a*x+b)*x+c)*x+d for x in range(p,q+1)] M=-10**10 m= 10**10 Mi=ni=p for i,n in enumerate(v): if n>M: Mi,M=i+p,n if n