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
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <math.h>
using namespace std;
#define F first
#define S second
const int N=1e5+10;
double min(double a,double b){return a>b?b:a;}
int main(){
    int n;
    double ans=1e9;
    pair<double,double>a[N];
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%lf%lf",&a[i].F,&a[i].S);
    sort(a,a+n);
    for(int i=0;i<n;i++)for(int j=1;j<300;j++)if(j+i<n)ans=min(ans,sqrt((a[i].F-a[i+j].F)*(a[i].F-a[i+j].F)+(a[i].S-a[i+j].S)*(a[i].S-a[i+j].S)));
    printf("%.20lf\n",ans);
}
