import java.util.*;
public class Score {
	public static void main(String args[]) {
		Scanner reader = new Scanner(System.in);
		int score[] = new int[6];
		int sum = 0;
		for (int i = 0; i < score.length; i++) {
			System.out.println("请输入第" + (i + 1) + "位评委的分数");
			score[i] = reader.nextInt();
		}
		Arrays.sort(score);
		System.out.println("去掉一个最高分" + score[5]);
		System.out.println("去掉一个最低分" + score[0]);
		for (int i = 1; i < score.length - 1; i++) {
			sum += score[i];
		}
		System.out.println("该选手最后的得分是：" + sum / 4);
	}
}