a, b, c, d, p, q = map(int, input().split()) def f(x): return a * x**3 + b * x**2 + c * x + d M, m, Mx, mx = -10**18, 10**18, -1000, -1000 for x in range(p, q + 1): v = f(x) if v > M: M = v Mx = x if v < m: m = v mx = x print(M, Mx, m, mx)