a, b, c, d, p, q = map(int, input().split()) f = lambda x: a*x**3+b*x**2+c*x+d INF = 10**15 M = -INF m = INF XM = p-1 xm = p-1 for x in range(p, q+1): t = f(x) if Mt: m=t xm=x print(M, XM, m, xm)