public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		StringBuilder out = new StringBuilder();
		while ((line = in.readLine()) != null && line.length() != 0) {
			int nSet = Integer.parseInt(line.trim());
			for (int i = 0; i < nSet; i++) {
				int size = Integer.parseInt(in.readLine().trim());
				int h[] = readInts(in.readLine()), k = 0;
				for (int j = h.length - 2; j >= 0; j--)
					if (h[j + 1] - h[j] == k)
						k++;
					else if (h[j + 1] - h[j] > k)
						k = h[j + 1] - h[j];
				if (h[0] == k)
					k++;
				else if (h[0] > k)
					k = h[0];
				out.append("Case " + (i + 1) + ": " + k + "\n");
			}
		}
		System.out.print(out);
	}