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 = 512;
	
	int dx[] = new int[] {-2, -2, -1, -1, 1, 1, 2, 2};
	int dy[] = new int[] {-1, 1, -2, 2, -2, 2, -1, 1};
	
	final long[][] moves = new long[][] {
			{2, 1, 1},
			{3, 3, 2},
			{4, 0, 2}
		};
		
		final long[] steps = new long[] {0, 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7, 1<<8, 1<<9, 1<<10,
				1L<<11, 1<<12, 1<<13, 1<<14, 1<<15, 1<<16, 1<<17, 1<<18, 1<<19, 1<<20, 1<<21,
				1L<<22, 1<<23, 1<<24, 1<<25, 1<<26, 1<<27, 1<<28, 1<<29, 1<<30, 1<<31};
		
	long distance(long x, long y)
	{
		if (x < y) {long t = x; x = y; y = t;}
		if (x >= -SZ && x < SZ)
			if (y >= -SZ && y < SZ)
				return D[(int) (x+SZ)][(int) (y+SZ)] - 1;
		
		long add = 0;
		if (x - y < SZ / 2)
		{
			long m33 = (y - SZ / 2 + 10) / 3;
			x -= m33 * 3;
			y -= m33 * 3;
			return m33 * 2 + distance(x, y);
		}
		if (Math.abs(x - 2 * y) < SZ / 2)
		{
			long m21 = Math.min((x - 20) / 2, y - 10);
			x -= m21 * 2;
			y -= m21 * 1;
			return m21 * 1 + distance(x, y);
		}
		if (y < SZ)
		{
			long m40 = (x - y + 10) / 4;
			x -= m40 * 4;
			y -= m40 * 0;
			return m40 * 2 + distance(x, y);
		}
		
		
		long res = Long.MAX_VALUE / 10;
		
		for (int i0 = 0; i0 < steps.length; i0++)
			for (int i1 = 0; i1 < steps.length; i1++)
				for (int i2 = 0; i2 < steps.length; i2++)
				{
					long tx = x - moves[0][0] * steps[i0] - moves[1][0] * steps[i1] - moves[2][0] * steps[i2];
					long ty = y - moves[0][1] * steps[i0] - moves[1][1] * steps[i1] - moves[2][1] * steps[i2];
					long tr = moves[0][2] * steps[i0] + moves[1][2] * steps[i1] + moves[2][2] * steps[i2];
					if (tx >= -SZ && tx < SZ)
						if (ty >= -SZ && ty < SZ)
						{
							
							tr += D[(int) (tx+SZ)][(int) (ty+SZ)] - 1;
							if (tr < res)
								res = tr;
						}
				}
		return res + add;
	}
	
	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();
	}
}
