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 <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef pair<double,double> P;

double D(P a,P b) {
  int x1=floor(a.F/10)*10,x2=floor(b.F/10)*10,y1=floor(a.S/10)*10,y2=floor(b.S/10)*10;
  if(x1!=a.F&&x2!=b.F&&x1==x2&&y1!=y2) {
    double d1=fabs(a.F-x1),d2=fabs(b.F-x2);
    return fabs(a.S-b.S)+min(d1+d2,20-d1-d2);
  } else if(y1!=a.S&&y2!=b.S&&y1==y2&&x1!=x2) {
    double d1=fabs(a.S-y1),d2=fabs(b.S-y2);
    return fabs(a.F-b.F)+min(d1+d2,20-d1-d2);
  }
  return fabs(a.F-b.F)+fabs(a.S-b.S);
}

int n,M=1<<29;
P a[11111];
double solve(int x,int y,double s,double t) {
  double ans=M;
  for(double l=x-30; l<=x+30; l+=s) {
    for(double r=y-30; r<=y+30; r+=t) {
      double d=0;
      for(int i=0; i<n; i++) d=max(d,D(a[i],P(l,r)));
      ans=min(ans,d);
    }
  }
  return ans;
}

int main() {
  cin >> n;
  double Max=-M,Mix=M,May=-M,Miy=M;
  for(int i=0; i<n; i++) {
    cin >> a[i].F >> a[i].S;
    Max=max(Max,a[i].F+a[i].S);
    Mix=min(Mix,a[i].F+a[i].S);
    May=max(May,a[i].F-a[i].S);
    Miy=min(Miy,a[i].F-a[i].S);
  }
  int xx=(Max+Mix)/2,yy=(May+Miy)/2;
  int x=floor((double)(xx+yy)/20)*10,y=floor((double)(xx-yy)/20)*10;
  printf("%.10f\n",min(solve(x,y,10,0.5),solve(x,y,0.5,10)));
  return 0;
}