a,b,c,d,p,q = map(int, input().split()) def f(x): return a*x**3+b*x**2+c*x+d M = -float('inf') m = float('inf') XM = p-1 xm = p-1 for x in range(p, q+1): if f(x) > M: M = f(x) XM = x if f(x) < m: m = f(x) xm = x print(M, XM, m, xm)