import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;


public class ANARC_2010_G_Alt
{
	BufferedReader in;
	Scanner inr;
	PrintWriter out;

	void initIO() throws IOException
	{
		inr = new Scanner(System.in);
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
	}
	
	long A[][], B[][];
	
	long dp[][];
	
	int D[][];
	
	long DC[][];
	
	int n;
	
	final int SZ = 256;
	
	int dx[] = new int[] {-2, -2, -1, -1, 1, 1, 2, 2};
	int dy[] = new int[] {-1, 1, -2, 2, -2, 2, -1, 1};
	
	long distance(long x, long y)
	{
		if (x < y) {long t = x; x = y; y = t;}
		long res = 0L;
		while (x >= SZ)
		{
			//System.out.println("" + x + " " + y + "");
			long diff = x - y;
			if (y > SZ)
			{
				long count = (y - SZ) / 3;
				x -= count * 3;
				y -= count * 3;
				res += count * 2;
			}
			else if (diff > 10)
			{
				long count = diff / 4;
				x -= count * 4;
				res += count * 2;
			}
			else
			{
				long count = (y - 10) / 3;
				x -= count * 3;
				y -= count * 3;
				res += count * 2;
			}
			
			if (x < y) {long t = x; x = y; y = t;}
		}
		res += D[(int) x + SZ][(int) y + SZ] - 1;
		return res;
	}
	
	long distance(long x1, long y1, long x2, long y2)
	{
		long dx = Math.abs(x1 - x2);
		long dy = Math.abs(y1 - y2);
		return distance(dx, dy);
	}
	
	long calc(int k, int mask)
	{
		if (k == n)
			return 0L;
		long res = dp[k][mask];
		if (res == 0)
		{
			res = Long.MAX_VALUE;
			for (int i = 0; i < n; i++)
				if ((mask & (1<<i)) == 0)
					res = Math.min(res, DC[k][i] + calc(k + 1, mask | (1<<i)));
			res++;
			dp[k][mask] = res;
		}
		return res - 1;
	}
	
	void solve() throws Exception
	{
		// precalc
		D = new int[2 * SZ][2 * SZ];
		Queue<Integer> qx = new LinkedList<Integer>();
		Queue<Integer> qy = new LinkedList<Integer>();
		qx.add(0);
		qy.add(0);
		D[SZ][SZ] = 1;
		while (qx.size() > 0)
		{
			int x = qx.poll();
			int y = qy.poll();
			for (int k = 0; k < 8; k++)
			{
				int tx = x + dx[k];
				int ty = y + dy[k];
				if (tx >= -SZ && tx < SZ)
					if (ty >= -SZ && ty < SZ)
						if (D[tx+SZ][ty+SZ] == 0)
						{
							D[tx+SZ][ty+SZ] = D[x+SZ][y+SZ] + 1;
							qx.add(tx);
							qy.add(ty);
						}
			}
		}
		// tests
		int nt = 0;
		while (true)
		{
			n = nextInt();
			if (n == 0)
				break;
			A = new long[n][2];
			B = new long[n][2];
			for (int i = 0; i < n; i++)
			{
				A[i][0] = nextInt();
				A[i][1] = nextInt();
			}
			for (int i = 0; i < n; i++)
			{
				B[i][0] = nextInt();
				B[i][1] = nextInt();
			}
			DC = new long[n][n];
			for (int i = 0; i < n; i++)
				for (int j = 0; j < n; j++)
					DC[i][j] = distance(A[i][0], A[i][1], B[j][0], B[j][1]);
			dp = new long[n][1<<n];
			long res = calc(0, 0);
			out.println((++nt) + ". " + res);
		}
	}

	void run() throws Exception
	{
		initIO();
		solve();
		out.flush();
	}

	int nextInt()
	{
		return inr.nextInt();
	}
	
	String nextLine()
	{
		return inr.nextLine();
	}
	
	String nextString()
	{
		return inr.next();
	}

	public static void main(String[] args) throws Exception
	{
		new ANARC_2010_G_Alt().run();
	}
}
