// Arup Guha
// 8/15/2014
// Solution to 2014 UCF Locals Problem: Fujiyama Thursday

import java.util.*;
import java.io.*;

public class sushi {

	public static void main(String[] args) throws Exception {

		Scanner stdin = new Scanner(new File("sushi.in"));
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Read input.
			int cars = stdin.nextInt();
			int[] carTimes = new int[cars];
			for (int i=0; i<cars; i++) 
				carTimes[i] = stdin.nextInt();
			int[] eatTimes = new int[4*cars];
			for (int i=0; i<4*cars; i++) 
				eatTimes[i] = stdin.nextInt();

			// Sort for greedy...
			Arrays.sort(carTimes);
			Arrays.sort(eatTimes);

			int best = 0;

			// Put slowest eaters in fastest cars.
			for (int i=0,j=4*cars-1; i<cars; i++,j-=4)
				best = Math.max(best, carTimes[i]+eatTimes[j]);

			// Print Solution.
			System.out.println("Trip #"+loop+": "+best);
		}
		
		stdin.close();
	}
}