1 // include file 2 #include < cstdio > 3 #include < cstdlib > 4 #include < cstring > 5 #include < cmath > 6 #include < cctype > 7 #include < ctime > 8 9 #include < iostream > 10 #include < sstream > 11 #include < fstream > 12 #include < iomanip > 13 #include < bitset > 14 #include < strstream > 15 16 #include < algorithm > 17 #include < string > 18 #include < vector > 19 #include < queue > 20 #include < set > 21 #include < list > 22 #include < functional > 23 24 using namespace std; 25 26 // typedef 27 typedef long long LL; 28 typedef unsigned long long ULL; 29 30 // 31 #define read freopen("in.txt","r",stdin) 32 #define write freopen("out.txt","w",stdout) 33 #define FORi(a,b,c) for(int i=(a);i<(b);i+=c) 34 #define FORj(a,b,c) for(int j=(a);j<(b);j+=c) 35 #define FORk(a,b,c) for(int k=(a);k<(b);k+=c) 36 #define FORp(a,b,c) for(int p=(a);p<(b);p+=c) 37 #define FORii(a,b,c) for(int ii=(a);ii<(b);ii+=c) 38 #define FORjj(a,b,c) for(int jj=(a);jj<(b);jj+=c) 39 #define FORkk(a,b,c) for(int kk=(a);kk<(b);kk+=c) 40 41 #define FF(i,a) for(int i=0;i<(a);i+++) 42 #define FFD(i,a) for(int i=(a)-1;i>=0;i--) 43 #define Z(a) (a<<1) 44 #define Y(a) (a>>1) 45 46 const double eps = 1e - 6 ; 47 const double INFf = 1e10; 48 const int INFi = 1000000000 ; 49 const double Pi = acos( - 1.0 ); 50 51 template < class T > inline T sqr(T a){ return a * a;} 52 template < class T > inline T TMAX(T x,T y) 53 { 54 if (x > y) return x; 55 return y; 56 } 57 template < class T > inline T TMIN(T x,T y) 58 { 59 if (x < y) return x; 60 return y; 61 } 62 template < class T > inline void SWAP(T & x,T & y) 63 { 64 T t = x; 65 x = y; 66 y = t; 67 } 68 template < class T > inline T MMAX(T x,T y,T z) 69 { 70 return TMAX(TMAX(x,y),z); 71 } 72 73 74 // code begin 75 int A[ 6 ],Amin,Amax,ans; 76 77 int main() 78 { 79 read; 80 write; 81 while (scanf( " %d %d %d %d %d %d " ,A,A + 1 ,A + 2 ,A + 3 ,A + 4 ,A + 5 ) !=- 1 ) 82 { 83 if (A[ 0 ] + A[ 1 ] + A[ 2 ] + A[ 3 ] + A[ 4 ] + A[ 5 ] == 0 ) break ; 84 Amin = INFi; 85 Amax = - 1 ; 86 ans = 0 ; 87 FORi( 0 , 6 , 1 ) 88 { 89 ans += A[i]; 90 Amin = TMIN(Amin,A[i]); 91 Amax = TMAX(Amax,A[i]); 92 } 93 printf( " %g\n " ,(ans - Amin - Amax + 0.0 ) / 4.0 ); 94 } 95 return 0 ; 96 }