a, b, c, d, p, q = map(int, input().split()) y = [] Y = [] for i in range(p, q+1): y += [i] Y += [i**3*a + i**2*b + i*c +d] M = max(Y) X = y[Y.index(M)] m = min(Y) x = y[Y.index(m)] print(M, X, m, x)