a,b,c,d,p,q = map(int,input().split()) def f(x): return a * (x ** 3) + b * (x ** 2) + c * x + d highest_y = -(1 << 60) highest_x = -1 lowest_y = 1 << 60 lowest_x = -1 for x in range(p, q + 1): y = f(x) if y > highest_y: highest_y = y highest_x = x if y < lowest_y: lowest_y = y lowest_x = x print(highest_y, highest_x, lowest_y, lowest_x)