import math def main(): a, b, c, d, p, q = map(int, input().split()) def f(x): return a * x ** 3 + b * x ** 2 + c * x + d mx, mi = -math.inf, math.inf x_max, x_min = -200, 200 for i in range(p, q + 1): if f(i) > mx: mx = f(i) x_max = i if f(i) < mi: mi = f(i) x_min = i print(mx, x_max, mi, x_min) if __name__ == "__main__": main()