#include <iostream>
#include <iomanip>
using namespace std;
int abs(int i,int j){
    if(i>j) return i-j;
    else return j-i;
}
int main() {
    int p,t,g1,g2,g3,gj;
    while(cin>>p>>t>>g1>>g2>>g3>>gj){
    if(abs(g1,g2)<=t) cout<<fixed<<setprecision(1)<<float(g1+g2)/2<<endl;
    else if(abs(g1,g3)<=t && abs(g2,g3)<=t){
        float r=float(max(max(g1,g2),g3));
        cout<<fixed<<setprecision(1)<<r<<endl;
    }
    else if(abs(g1,g3)<=t) cout<<fixed<<setprecision(1)<<float(g1+g3)/2<<endl;
    else if(abs(g2,g3)<=t) cout<<fixed<<setprecision(1)<<float(g2+g3)/2<<endl;
    else cout<<fixed<<setprecision(1)<<float(gj)<<endl;
}
}