a,b,c,d,p,q=map(int,input().split()) def f(x): return a*(x**3)+b*(x**2)+c*x+d y=[(f(x),x) for x in range(p,q+1)] m=min(y) y=[(f(x),-x) for x in range(p,q+1)] M=max(y) print(M[0],M[1],m[0],m[1])