a,b,c,d,p,q = list(map(int,input().split())) def f(x): return d + x * (c + x * (b + x * a)) M = f(p) m = f(p) Mx = p mx = p for i in range(p+1,q+1): u = f(i) if u > M: M = u Mx = i elif u < m: m = u mx = i print(M,Mx,m,mx)