#include<bits/stdc++.h>
using namespace std;
const int N=2e5+2;
const double INF=1e10;
struct node{
double x,y;
}a[N],tmp[N];
bool cmp(node n1,node n2){
if(n1.x!=n2.x){
return n1.x<n2.x;
}
return n1.y<n2.y;
}
bool cmpy(node n1,node n2){
return n1.y<n2.y;
}
double dist(node n1,node n2){
double res=pow(n1.x-n2.x,2)+pow(n1.y-n2.y,2);
return sqrt(res);
}
double cal(int left,int right){
double d=INF;
if(left==right){
return d;
}
if(left+1==right){
d=dist(a[left],a[right]);
return d;
}
int mid=(left+right)/2;
double d1=cal(left,mid),d2=cal(mid+1,right);
d=min(d1,d2);
int k=0;
for(int i=left;i<=right;i++){
if(abs(a[i].x-a[mid].x)<d){
tmp[++k]=a[i];
}
}
sort(tmp+1,tmp+1+k,cmpy);
for(int i=1;i<=k-1;i++){
for(int j=i+1;j<=k;j++){
if((tmp[j].y-tmp[i].y)>d){
break;
}
double d3=dist(tmp[i],tmp[j]);
d=min(d,d3);
}
}
return d;
}
int main(){
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%lf %lf",&a[i].x,&a[i].y);
}
sort(a+1,a+1+n,cmp);
double res=cal(1,n);
printf("%.4lf\n",res);
return 0;
}