#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int get_max(int a,int b,int c){
    int max=0;
    max=(a>b?a:b);
    max=(max>c?max:c);
    return max;
}
int main(){
    int P,T,G1,G2,G3,GJ;
    float G;
    while(scanf("%d%d%d%d%d%d\n",&P,&T,&G1,&G2,&G3,&GJ)!=EOF){
        if(G1>(float)P){
            break;
        }
        if(abs(G1-G2)<=T){
            G=(float)(G1+G2)/2;
        }
        else{
            if(abs(G3-G1)<=T&&abs(G3-G2)<=T){
                G=(float)get_max(G1, G2, G3);
            }
            else if(abs(G3-G1)>T&&abs(G3-G2)>T){
                G=(float)GJ;
            }
            else{
                if(abs(G3-G1)<=T){
                    G=(float)(G1+G3)/2;
                }
                else{
                    G=(float)(G2+G3)/2;
                }
            }
        }
        printf("%.1f\n",G);
    }
    return 0;
}