#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int P,T,G1,G2,G3,GJ;
float ans;
int MAX(int a,int b,int c){
a = a > b ? a : b;
a = a > c ? a : c;
return a;
}
int closest(int a,int b,int c){
if(abs(a - c) < abs(b - c)) return a;
else return b;
}
int main(){
while(scanf("%d %d %d %d %d %d",&P,&T,&G1,&G2,&G3,&GJ) != EOF){
if(abs(G1-G2) <= T) ans = ((float)G1+(float)G2)/2.0;
else{
if((abs(G1-G3) <= T) && (abs(G2-G3) > T) || (abs(G1-G3) > T) && (abs(G2-G3) <= T))
ans = ((float)G3 + (float)(closest(G1,G2,G3)))/2.0;
else if((abs(G1-G3) <= T && (abs(G2-G3) <= T))) ans = (float)MAX(G1,G2,G3);
else ans = (float)GJ;
}
printf("%.1f\n",ans);
}
return 0;
}
/**************************************************************
Problem: 1002
User: Doom_Judgement
Language: C++
Result: Accepted
Time:0 ms
Memory:1020 kb
****************************************************************/