Problem: For given n points in metric space, find the distance of the closest points.

Constraints

* 2 ≤ n ≤ 100,000
* -100 ≤ x, y ≤ 100

Input


n
x0 y0
x1 y1
:
xn-1 yn-1


The first integer n is the number of points.

In the following n lines, the coordinate of the i-th point is given by two real numbers xi and yi. Each value is a real number with at most 6 digits after the decimal point.

Output

Print the distance in a line. The output values should be in a decimal fraction with an error less than 0.000001.

Examples

Input

2
0.0 0.0
1.0 0.0


Output

1.000000


Input

3
0.0 0.0
2.0 0.0
1.0 1.0


Output

1.41421356237

Solution (in CPP):

Solution:
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
double x[110000];
double y[110000];
pair<double,double>p[110000];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++){
		double X,Y;
		scanf("%lf%lf",&X,&Y);
		x[i]=cos(1)*X-sin(1)*Y;
		y[i]=sin(1)*X+cos(1)*Y;
		p[i]=make_pair(x[i],y[i]);
	}
	std::sort(p,p+a);
	double ret=99999999;
	for(int i=0;i<a;i++){
		for(int j=i-1;j>=0;j--){
			if(p[i].first-p[j].first>ret)break;
			ret=min(ret,sqrt((p[i].first-p[j].first)*(p[i].first-p[j].first)+(p[i].second-p[j].second)*(p[i].second-p[j].second)));
		}
	}
	printf("%.12f\n",ret);
}