INF = 1 << 60 def f(x): global a, b, c, d return a * x ** 3 + b * x ** 2 + c * x + d a, b, c, d, p, q = map(int, input().split()) minimum_x = INF minimum_y = INF maximum_x = -INF maximum_y = -INF for i in range(p, q + 1): if f(i) < minimum_y: minimum_x = i minimum_y = f(i) if f(i) > maximum_y: maximum_x = i maximum_y = f(i) print(maximum_y, maximum_x, minimum_y, minimum_x)