#include <cmath>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;

void grade(int T, int G1, int G2, int G3, int GJ){
    if(fabs(G1 - G2) <= T){
        printf("%.1f\n", 1.0*(G1+G2)/2);
    }else{
        if (fabs(G1 - G3) <= T && fabs(G1 - G3) <= T) {
            printf("%.1f\n", max(G1, G2));
        }else if (fabs(G1 - G3) <= T) {
            printf("%.1f\n", 1.0*(G1+G3)/2);
        }else if (fabs(G2 - G3) <= T) {
            printf("%.1f\n", 1.0*(G2+G3)/2);
        }else{
            printf("%.1f\n", GJ);
        }
    }
}

int main() {
    int P, T, G1, G2, G3, GJ;
    while (cin >> P >> T >> G1 >> G2 >> G3 >> GJ) {
        grade( T,  G1,  G2,  G3,  GJ);
    }
    return 0;
}
// 64 位输出请用 printf("%lld")