private void doMain(BufferedReader reader, PrintStream writer) throws Exception {
		
		int n = Integer.parseInt(reader.readLine());

		for (int icase = 0; icase !=n; ++icase) {
		
			int c = Integer.parseInt(reader.readLine());

			int itemsNum = Integer.parseInt(reader.readLine());
		
			String itemsLine = reader.readLine();
			
			int[] items = new int[itemsNum];

			int l = 0;
			StringTokenizer tokenizer = new StringTokenizer(itemsLine, " ");
			while(tokenizer.hasMoreTokens()) {
				items[l++] = Integer.parseInt(tokenizer.nextToken());
			}
			
			int sol = Integer.MAX_VALUE;
			int firstItemSol = 0;
			int secondItemSol = 0;
			
			for (int i = 0; i != items.length; ++i) {
				
				if (items[i] <= c) {
					
					for (int j = i+1; j < items.length; ++j) {
						
						int rest  = c - ( items[i] + items[j] );
						if (rest >= 0 && rest < sol) {
							firstItemSol = i + 1;
							secondItemSol = j + 1;
							sol = rest;
						}
						
					}
					
				}
				
			}
			
			
			writer.println("Case #" + (icase+1) + ": " + firstItemSol + " " + secondItemSol);
			
		}
		

	}