#include <algorithm>
#include <cmath>
using namespace std;
#define INF 2000000000.0
#define DIM 1000005
struct punct {int x,y;} v[DIM],a[DIM],p;
int n,m;
void read ()
{
int i;
scanf ("%d",&n);
for (i=1; i<=n; ++i)
scanf ("%d%d",&v[i].x,&v[i].y);
}
struct cmp1
{
bool operator () (const punct &a,const punct &b) const
{
return a.x<b.x;
}
};
struct cmp2
{
bool operator () (const punct &a,const punct &b) const
{
return a.y<b.y;
}
};
double dist (punct a,punct b)
{
return sqrt ((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
int cbin (punct p,double d,int st,int dr)
{
int mij,sol;
for (sol=dr; st<=dr; )
{
mij=(st+dr)/2;
if (p.y-d<=a[mij].y)
{
dr=mij-1;
sol=mij;
}
else
st=mij+1;
}
return sol;
}
double calc (int st,int dr,punct &p)
{
double d,d1,d2,dmin;
int mij,i,j;
punct p1,p2;
if (st>=dr)
{
p.x=p.y=-1;
return INF;
}
if (st+1==dr)
{
p=v[st];
return dist (v[st],v[dr]);
}
mij=(st+dr)/2;
d1=calc (st,mij,p1);
d2=calc (mij+1,dr,p2);
if (d1<=d2)
{
dmin=d=d1;
p=p1;
}
else
{
dmin=d=d2;
p=p2;
}
for (m=0, j=mij+1; v[j].x<=v[mij].x+d && j<=dr; ++j)
a[++m]=v[j];
sort (a+1,a+m+1,cmp2 ());
for (i=st; i<=mij; ++i)
for (j=cbin (v[i],d,1,m); v[i].y-d<=a[j].y && a[j].y<=v[i].y+d && j<=m; ++j)
if (dist (v[i],a[j])<dmin)
{
dmin=dist (v[i],a[j]);
p=v[i];
}
return dmin;
}
int main ()
{
freopen ("cmap.in","r",stdin);
freopen ("cmap.out","w",stdout);
read ();
sort (v+1,v+n+1,cmp1 ());
printf ("%lf\n",calc (1,n,p));
return 0;
}