#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


enum Type{
	First,
	Second,
};


struct Point{
	double x,y;
};

struct Line{
	Point p[2];
	double length;
};


int N,case_num = 1;
int POW[15];
Line line[15];
double min_cost[16384][14][2];

double calc_dist(Point a,Point b){
	return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}

void func(){

	for(int i = 0; i < N; i++){
		scanf("%lf %lf %lf %lf",&line[i].p[0].x,&line[i].p[0].y,&line[i].p[1].x,&line[i].p[1].y);
		line[i].length = calc_dist(line[i].p[0],line[i].p[1]);
	}

	double dist_first,dist_second,ans = 9999999.0;


	for(int start = 0; start < N; start++){

		for(int state = 0; state < POW[N]; state++){
			for(int current = 0; current < N; current++){
				min_cost[state][current][First] = 9999999.0;
				min_cost[state][current][Second] = 9999999.0;
			}
		}

		for(int next = 0; next < N; next++){
			if(next == start)continue;

			dist_first = calc_dist(line[start].p[0],line[next].p[0]);
			dist_second = calc_dist(line[start].p[1],line[next].p[0]);

			min_cost[POW[next]+POW[start]][next][First] = min(dist_first,dist_second)+line[start].length;

			dist_first = calc_dist(line[start].p[0],line[next].p[1]);
			dist_second = calc_dist(line[start].p[1],line[next].p[1]);

			min_cost[POW[next]+POW[start]][next][Second] = min(dist_first,dist_second)+line[start].length;
		}

		for(int state = 2; state < POW[N]; state++){
			for(int last_line = 0; last_line < N; last_line++){
				if(min_cost[state][last_line][First] == 9999999.0)continue;

				for(int next_line = 0; next_line < N; next_line++){
					if(state & (1 << next_line)){
						//Do nothing
					}else{

						dist_first = calc_dist(line[next_line].p[0],line[last_line].p[0]);
						dist_second = calc_dist(line[next_line].p[0],line[last_line].p[1]);

						min_cost[state+POW[next_line]][next_line][First] = min(min_cost[state+POW[next_line]][next_line][First],
								min(min_cost[state][last_line][First]+dist_second,min_cost[state][last_line][Second]+dist_first)+line[last_line].length);


						dist_first = calc_dist(line[next_line].p[1],line[last_line].p[0]);
						dist_second = calc_dist(line[next_line].p[1],line[last_line].p[1]);

						min_cost[state+POW[next_line]][next_line][Second] = min(min_cost[state+POW[next_line]][next_line][Second],
								min(min_cost[state][last_line][First]+dist_second,min_cost[state][last_line][Second]+dist_first)+line[last_line].length);

					}
				}
			}
		}

		for(int last_line = 0; last_line < N; last_line++){
			if(last_line == start)continue;

			ans = min(ans,min(min_cost[POW[N]-1][last_line][First],min_cost[POW[N]-1][last_line][Second])+line[last_line].length);
		}
	}

	printf("Case %d: %.5lf\n",case_num,ans);
	case_num++;
}

int main(){

	for(int i = 0; i < 15; i++)POW[i] = pow(2,i);

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}



Measured memory_bytes: 6940