a, b, c, d, p, q = map(int, input().split()) def f(x): return a * x ** 3 + b * x ** 2 + c * x + d min_s = [0, 10 ** 20] max_s = [0, -10 ** 20] for x in range(p, q + 1): y = f(x) if y < min_s[1]: min_s[1] = y min_s[0] = x if y > max_s[1]: max_s[1] = y max_s[0] = x print(max_s[1], max_s[0], min_s[1], min_s[0])