#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	// Basically want to find min (x,y) such that sum of dist from all points to (x,y) is minimized
	// Finding median of x and y.
	int n, j=1;
	cin >> n;
	while(n > 0) {
		int x[n], y[n];

		for(int i=0; i<n; i++) {
			cin >> x[i] >> y[i];
		}

		sort(x, x+n);
		sort(y, y+n);

		int ansx = x[(n-1)/2], ansy = y[(n-1)/2];
		int dist = 0;
		for(int i=0; i<n; i++) {
			dist += abs(x[i]-ansx);
			dist += abs(y[i]-ansy);
		}
		cout << "Case " << j << ": (" << ansx << "," << ansy << ") " << dist << endl;
		j++;
		cin >> n;
	}
}