Problem: The city of Kyoto is a famous tourist destination for old temples and shrines.

Ikta came to Kyoto sightseeing with a few friends, but as a result of all acting freely, they all got lost.

So Ikta decided to think about where to meet in order to meet everyone as soon as possible.

Kyoto's roads run innumerably at intervals of 10 from east to west and north to south, and can be regarded as an infinitely wide square grid.

Roads are considered straight and have no width. In addition, the position moved by a distance x to the east and a distance y to the north with respect to the center of the city is represented by the coordinates (x, y).

At the center of the city (0,0), the east-west road and the north-south road intersect.

The figure below illustrates the roads of Kyoto and the coordinates of some points.


<image>


Since the coordinates (Xi, Yi) of N tourists are given as integers, answer the minimum time required for N people to move on the road and gather at one point.

Tourists can move continuously on the road at a speed of 1 distance per hour.

The coordinates of the N tourists given are different, and all coordinates are guaranteed to be on the road.

It is also possible for multiple tourists to exist at one point at the same time, or for tourists to move so that they pass each other.



Input

The input is given in the following format.

> N
> X1 Y1
> ...
> XN YN
>

N in the first line is the number of tourists. The i-th line (1 ≤ i ≤ N) of the next N lines represents the location of the i-th tourist (Xi, Yi). Xi and Yi are given as integers, respectively.

Constraints

Each variable being input satisfies the following constraints.

* 2 ≤ N ≤ 10000
* −108 ≤ Xi, Yi ≤ 108
* When i ≠ j (Xi, Yi) ≠ (Xj, Yj)
* At least one of Xi and Yi is a multiple of 10.

Output

Print the solution to the problem on one line. Allows absolute error up to 10-3.

Examples

Input

3
5 10
-10 0
3 -10


Output

14


Input

2
0 0
0 1


Output

0.5


Input

4
100000000 100000000
100000000 -100000000
-100000000 100000000
-100000000 -100000000


Output

200000000

Solution (in CPP):

Solution:
#include<stdio.h>
#include<algorithm>
using namespace std;
int x[11000];
int y[11000];
int X[11000];
int Y[11000];
int ABS(int a){return max(a,-a);}
int dist(int X1,int Y1,int X2,int Y2){
	X1+=200000000;
	X2+=200000000;
	Y1+=200000000;
	Y2+=200000000;
	if(X1%20==0&&X2%20==0&&X1==X2)return ABS(Y1-Y2);
	if(Y1%20==0&&Y2%20==0&&Y1==Y2)return ABS(X1-X2);
	if(X1%20==0&&X2%20==0&&Y1/20==Y2/20)return ABS(X1-X2)+min(Y1%20+Y2%20,40-Y1%20-Y2%20);
	if(Y1%20==0&&Y2%20==0&&X1/20==X2/20)return ABS(Y1-Y2)+min(X1%20+X2%20,40-X1%20-X2%20);
	
	return ABS(X1-X2)+ABS(Y1-Y2);
}
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d%d",x+i,y+i);
	for(int i=0;i<a;i++){
		x[i]*=2;y[i]*=2;
		X[i]=x[i]+y[i];
		Y[i]=x[i]-y[i];
	}
	std::sort(X,X+a);
	std::sort(Y,Y+a);
	int xx=(X[0]+X[a-1])/2;
	int yy=(Y[0]+Y[a-1])/2;
	int mx=(xx+yy)/2;
	int my=(xx-yy)/2;
	double ret=9999999999999.9;
	for(int i=mx-50;i<=mx+50;i++){
		for(int j=my-50;j<=my+50;j++){
			if(ABS(i)%20&&ABS(j)%20)continue;
			int tmp=0;
			for(int k=0;k<a;k++){
				tmp=max(tmp,dist(i,j,x[k],y[k]));
			}
		//	if(tmp<30)printf("%d %d: %d\n",i,j,tmp);
			ret=min(ret,(double)tmp/2);
		}
	}
	printf("%.12f\n",ret);
}