// Arup Guha
// 6/27/06
// Solution to 2006 BHCSI Contest Question Cheer
import java.io.*;
import java.util.*;

public class cheer {

	public static void main(String[] args) throws IOException {
		
		// Open the input file.
		Scanner fin = new Scanner(new File("cheer.in"));
		
		// Read in the number of cheerleading squads.
		int numsquads = fin.nextInt();
		
		// Process each case.
		for(int i = 1;i <= numsquads;i++){
			
			int sum = 0, score, max;
		
			// Read in the first judge score.
			score = fin.nextInt();
		
			// Initialize the sum of scores and the maximum score based
			// on the first score.
			sum += score;
			max = score;
			
			// Read in the other five scores.
			for (int j=0; j<5; j++) {
				score = fin.nextInt();
				sum += score; // Adjust the sum of the scores.
				
				// Adjust the maximum score if necessary.
				if (score > max)
					max = score;
			}
			
			// Drop the maximum score by subtracting it from the sum.
			sum -= max;
			
			// We can print the average by dividing by 5.0, since we
			// need to do a double division and we know that there will
			// always be exactly five scores that count.
			System.out.println("Score for Squad #"+i+": "+sum/5.0);
			
		}
		
		fin.close();
		
	}

}