public static void main(String[] args) {
		long start = System.currentTimeMillis();
		try {
			FileReader fr = new FileReader(SourcePath.getInputPath() + "/googleCodeJam/roundqualification2014/D-large.in");
			FileWriter fw = new FileWriter(SourcePath.getOutputPath() + "/googleCodeJam/roundqualification2014/D-large.out");

			BufferedReader br = new BufferedReader(fr);
			BufferedWriter bw = new BufferedWriter(fw);
			int numOfCases = Integer.valueOf(br.readLine());
			
			StringBuffer outPut = new StringBuffer();
			
			String result;
			int numOfBlocks; 
			String[] naomiArray;
			String[] kenArray;
			List<Double> naomiList;
			List<Double> kenList;
			
			for (int i = 0; i < numOfCases; i++){
				numOfBlocks = Integer.valueOf(br.readLine());
				
				naomiArray = br.readLine().split(" ");
				kenArray = br.readLine().split(" ");
				naomiList = new ArrayList<Double>(numOfBlocks);
				kenList = new ArrayList<Double>(numOfBlocks);
				
				for (int j = 0; j < numOfBlocks; j++){
					naomiList.add(Double.valueOf(naomiArray[j]));
					kenList.add(Double.valueOf(kenArray[j]));
				}
				
				Collections.sort(naomiList);
				Collections.sort(kenList);
				
				result = String.valueOf(getDeceitfulWarPoint(naomiList, kenList)).concat(" ").concat(String.valueOf(getWarPoint(naomiList, kenList)));
				System.out.println("Case #" + (i + 1) + ": " + result);
				outPut.append("Case #").append(i+1).append(": ").append(result).append("\n");
			}
			
			br.close();
			fr.close();
			bw.write(outPut.toString());
			bw.flush();
			bw.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		long end = System.currentTimeMillis();
		
		System.out.println(end - start);
	}