import sys readline=sys.stdin.readline write=sys.stdout.write from math import gcd as GCD import math a,b,c,d,p,q=map(int,readline().split()) def f(x): return a*x**3+b*x**2+c*x+d M=max(f(x) for x in range(p,q+1)) m=min(f(x) for x in range(p,q+1)) for xM in range(p,q+1): if f(xM)==M: break for xm in range(p,q+1): if f(xm)==m: break print(M,xM,m,xm)