from math import sqrt C = list(map(int, input().split())) L, R = map(int, input().split()) def func(x): y = 0.0 a = 1.0 for i in range(4): y += C[i] * a a *= x return y Y = [func(L), func(R)] D = [i * C[i] for i in range(1, 4)] if C[3] and D[1] * D[1] - 4 * D[0] * D[2] > 0: l = (-D[1] - sqrt(D[1] * D[1] - 4 * D[0] * D[2])) / (2 * D[2]) r = (-D[1] + sqrt(D[1] * D[1] - 4 * D[0] * D[2])) / (2 * D[2]) if L < l < R: Y.append(func(l)) if L < r < R: Y.append(func(r)) elif C[2]: m = -D[0] / D[1] if L < m < R: Y.append(func(m)) if max(Y) < 0: print(-max(Y)) elif min(Y) > 0: print(min(Y)) else: print(0)