// Arup Guha
// 9/18/2012
// Solution to 2008 BHCSI Problem: Neighbor
import java.util.*;

public class neighbor2 {
	
	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		
		// Go through all cases.
		int numCases = stdin.nextInt();
		for (int loop=1; loop<=numCases; loop++) {
			
			// Read in the donations for each house.
			int n = stdin.nextInt();
			int[] donations = new int[n];
			for (int i=0; i<n; i++)
				donations[i] = stdin.nextInt();
			
			// Avoids array out of bounds...	
			if (n < 3) {
				if (donations[0] >= donations[1])
					System.out.println("Case #"+loop+": "+donations[0]+" : 0");
				else
					System.out.println("Case #"+loop+": "+donations[1]+" : 1");
				continue;
			}
			
			// Stores best values and next house to go to, to obtain it.
			int[] best = new int[n];
			int[] next = new int[n];
			
			// Starting values.
			best[n-1] = donations[n-1];
			best[n-2] = donations[n-2];
			best[n-3] = donations[n-3] + donations[n-1];
			next[n-1] = -1;
			next[n-2] = -1;
			next[n-3] = n-1;
			
			// Fill in rest, going backwards.
			for (int i=n-4; i>=0; i--) {
				
				// We want to take the earlier item, if possible.
				if (best[i+2] >= best[i+3]) {
					best[i] = best[i+2] + donations[i];
					next[i] = i+2;
				}
				else {
					best[i] = best[i+3] + donations[i];
					next[i] = i+3;					
				}
			}
			
			int start = 0;
			
			// Print out the maximum donations.
			if (best[0] >= best[1]) 
				System.out.print("Case #"+loop+": "+best[0]+" :");
			else {
				System.out.print("Case #"+loop+": "+best[1]+" :");	
				start = 1;
			}
			
			// Print out whole list of houses.
			while (start != -1) {
				System.out.print(" "+start);
				start = next[start];
			}		
			System.out.println();
		}
	}
}