#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
double X1[20];
double Y1[20];
double X2[20];
double Y2[20];
double dp[1<<14][14][2];
int main(){
	int T=0;
	int a;
	while(scanf("%d",&a),a){
		for(int i=0;i<a;i++)scanf("%lf%lf%lf%lf",X1+i,Y1+i,X2+i,Y2+i);
		for(int i=0;i<(1<<a);i++)for(int j=0;j<a;j++)for(int k=0;k<2;k++)
			dp[i][j][k]=999999999;
		for(int i=0;i<a;i++){
			dp[1<<i][i][0]=dp[1<<i][i][1]=0;
		}
		for(int i=0;i<(1<<a);i++){
			for(int j=0;j<a;j++){
				for(int k=0;k<2;k++){
					if(dp[i][j][k]>99999999)continue;
					for(int l=0;l<a;l++){
						if(i&(1<<l))continue;
						if(!k){
							dp[i+(1<<l)][l][0]=min(dp[i+(1<<l)][l][0],dp[i][j][k]+sqrt((X1[l]-X2[j])*(X1[l]-X2[j])+(Y1[l]-Y2[j])*(Y1[l]-Y2[j])));
							dp[i+(1<<l)][l][1]=min(dp[i+(1<<l)][l][1],dp[i][j][k]+sqrt((X2[l]-X2[j])*(X2[l]-X2[j])+(Y2[l]-Y2[j])*(Y2[l]-Y2[j])));
						}else{
							dp[i+(1<<l)][l][0]=min(dp[i+(1<<l)][l][0],dp[i][j][k]+sqrt((X1[l]-X1[j])*(X1[l]-X1[j])+(Y1[l]-Y1[j])*(Y1[l]-Y1[j])));
							dp[i+(1<<l)][l][1]=min(dp[i+(1<<l)][l][1],dp[i][j][k]+sqrt((X2[l]-X1[j])*(X2[l]-X1[j])+(Y2[l]-Y1[j])*(Y2[l]-Y1[j])));
						}
					}
				}
			}
		}
		double ret=999999999;
		for(int i=0;i<a;i++){
			ret=min(ret,dp[(1<<a)-1][i][0]);
			ret=min(ret,dp[(1<<a)-1][i][1]);
		}
		for(int i=0;i<a;i++)ret+=sqrt((X1[i]-X2[i])*(X1[i]-X2[i])+(Y1[i]-Y2[i])*(Y1[i]-Y2[i]));
		printf("Case %d: %.5f\n",++T,ret);
	}
}