def m(a, b): if a > b: return a else: return b def m3(a, b, c): s = [] s.append(a) s.append(b) s.append(c) return max(s) def Grading(p, t, g1, g2, g3, gj): if abs(g1-g2) <= t: return round(((g1+g2) / 2), 1) else: if abs(g1-g3) <= t and abs(g2-g3) <= t: return m3(g1, g2, g3) elif abs(g1-g3) <= t and abs(g1-g3) > t or abs(g1-g3) > t and abs(g1-g3) <= t: k = m(abs(g1-g3), abs(g2-g3)) return round(k + g3 +g3, 1) else: return gj while True: try: p, t, g1, g2, g3, gj = map(int, input().split()) res = Grading(p, t, g1, g2, g3, gj) print(res) except: break