a, b, c, d, p, q = map(int, input().split()) def f(x): ret = a * x ** 3 + b * x ** 2 + c * x + d return ret MAX = -(1<<60) MIN = 1<<60 xmax = -(1<<60) xmin = -(1<<60) for x in range(p,q+1): fx = f(x) if fx > MAX: MAX = fx xmax = x if fx < MIN: MIN = fx xmin = x print(MAX,xmax,MIN,xmin)