Judging Olympia#1625

Judging Olympia

1 second
64 megabytes
Easy

For years, a group of Regional Contest Directors (RCDs) of the ACM International Collegiate Programming Contest (ICPC) have been unsatisfied with the way contest submissions are ranked. The group sees it as academically wrong to emphasize the importance of program correctness while disregarding the "quality" of the program itself. After all, programming as a profession encompasses design, style, maintainability, and other aspects, not just correctness. The group’s suggestion is to have a panel of six judges, each grading the submissions based on a particular aspect: 1) Correctness; 2) Robustness; 3) Overall design; 4) Clarity; 5) Coding style; and 6) Maintainability. The final grade of a submission would be the average of the six grades it receives.

Supporters of the current ICPC judging style respond that it is not possible to impartially judge a program on anything but correctness. How can the ICPC be sure that judging is fair? In other words, how can ICPC ensure that none of the judges are favoring some teams and disadvantaging others? Any accusation affecting the judging process could cause ICPC to lose the prestigious status it has built over the years. (Alright! So they do have a point.) Still, this hasn’t stopped other domains from judging candidates based on subjective criteria. For example, Gymnastics, Nobel Prizes, or even the ACM’s own Doctoral Dissertation Award. All are highly respected awards where the winner is selected by judges using subjective metrics. ICPC could use a new judging system based on what is used in gymnastics. Rather than each judge grading a certain aspect, each of the six judges would assign an overall grade (out of ten) based on all of the six metrics above. To ensure impartiality, the final grade would be calculated as the average of all grades after deleting two grades: the highest and the lowest. Any judge who favors a team (and assigns an undeservedly high grade) risks that grade being dismissed. Likewise, any judge trying to disadvantage a team by assigning a low grade faces a similar risk.

Write a program to print the final grade of a submission.

Input

Your program will be tested on one or more test cases. Each test case is given by a single input line listing the grades of the judges. The end of the test cases is indicated by a dummy test case in which all grades are zero.

Output

For each test case, print the grade on a separate line (without unnecessary decimal points and/or zeros.)

Examples

Example 1

Loading
Loading