// Arup Guha
// 11/26/2015
// Solution to 2009 World Finals Problem D: Conduit Packing

import java.util.*;

public class conduit {

	final public static double EPSILON = 1e-9;
	public static int[] circles;
	final public static int[][] ORDERS = {{0,1,2,3}, {0,1,3,2}, {0,2,1,3}, {0,2,3,1}, {0,3,1,2}, {0,3,2,1}};

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		circles = new int[4];
		circles[0] = stdin.nextInt();
		int loop = 1;

		// Process each case.
		while (circles[0] != 0) {

			// Read in the rest.
			for (int i=1; i<4; i++) circles[i] = stdin.nextInt();

			// Output the result.
			System.out.printf("Case %d: %.0f\n", loop, solve());

			// Start getting the next case.
			circles[0] = stdin.nextInt();
			loop++;
		}

	}

	// Solve it - trying all 6 permutations.
	public static double solve() {
		double res = circles[0]+circles[1]+circles[2]+circles[3];
		for (int i=0; i<ORDERS.length; i++) {
			double tmp = solvePerm(ORDERS[i]);
			res = Math.min(res, tmp);
		}
		return res;
	}

	public static double solvePerm(int[] perm) {

		// Simple low and high bounds.
		double low = circles[0]+circles[1], high = circles[0]+circles[1]+circles[2]+circles[3];

		// Run a regular binary search.
		while (high - low > 1e-9) {
			double mid = (low+high)/2;
			if (canDo(perm, mid))
				high = mid;
			else
				low = mid;
		}

		// A safe return value.
		return high;
	}

	public static boolean canDo(int[] perm, double r) {

		// Place first circle center on positive x axis. Big circle is radius r with center (0, 0).
		double[][] centers = new double[4][2];
		centers[0][0] = r-circles[perm[0]];
		centers[0][1] = 0;

		double[] curangle = new double[4];

		// Find centers of the other three circles.
		for (int i=1; i<4; i++) {

			double angle = 0;

			// Need to check this circle with all previous circles.
			for (int j=1; i-j>=0; j++) {

				// We will use these, so set them.
				int r1 = circles[perm[i-j]];
				int r2 = circles[perm[i]];

				// Get the three side of the triangle formed by the relevant centers of circles.
				double a = r - r1;
				double b = r - r2;
				double c = r1 + r2;
				if (a + b < c) return false;

				// Get the central angle and update our current angle.
				double tmp = Math.acos( (a*a+b*b-c*c)/(2*a*b) );
				angle = Math.max(angle, tmp+curangle[i-j]);
			}

			// Store the center of this circle.
			curangle[i] = angle;
			centers[i][0] = (r-circles[perm[i]])*Math.cos(curangle[i]);
			centers[i][1] = (r-circles[perm[i]])*Math.sin(curangle[i]);
		}

		// This arrangement is invalid if any of the two circles intersect.
		for (int i=0; i<4; i++)
			for (int j=i+1; j<4; j++)
				if (dist(centers[i], centers[j]) < circles[perm[i]] + circles[perm[j]] - EPSILON)
					return false;

		// If we get here, we're good!
		return true;
	}

	// Returns the distance between pt1 and pt2.
	public static double dist(double[] pt1, double[] pt2) {
		return Math.sqrt(Math.pow(pt1[0]-pt2[0],2) + Math.pow(pt1[1]-pt2[1],2));
	}
}