#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct point2dfloat{
  double x,y;
} point;

int cmp(const void *a,const void *b){
  const point *p=(point *)a;
  const point *q=(point *)b;
  if(p->x!=q->x) return p->x>q->x?1:-1;
  if(p->y!=q->y) return p->y>q->y?1:-1;
  return 0;
}

double distance(const point *a,const point *b){
  double dx=a->x-b->x;
  double dy=a->y-b->y;
  return sqrt(dx*dx+dy*dy);
}

double closestPairDistance(const point *p,int n){
  if(n<=3){
    double min=400;
    int i,j;
    for(i=0;i<n;i++){
      for(j=i+1;j<n;j++){
	min=MIN(min,distance(p+i,p+j));
      }
    }
    return min;
  }
  int m=n/2;
  double l=closestPairDistance(p,m);
  double r=closestPairDistance(p+m,n-m);
  double g=MIN(l,r);
  double mid=(p[m-1].x+p[m].x)/2;
  int ll=m-1;
  while(ll>=0 && mid-p[ll].x<g) ll--;
  int rr=m;
  while(rr<n && p[rr].x-mid<g) rr++;

  double min=g;
  int i,j;
  for(i=m-1;i>ll;i--){
    for(j=m;j<rr;j++){
      min=MIN(min,distance(p+i,p+j));
    }
  }
  return min;
}

void run(void){
  int n;
  scanf("%d",&n);
  point a[100000];
  int i;
  for(i=0;i<n;i++){
    scanf("%lf%lf",&(a[i].x),&(a[i].y));
  }
  srand((unsigned)time(NULL));
  double theta=(M_PI/2)*((double)rand()/RAND_MAX);
  double c=cos(theta);
  double s=sin(theta);
  point b[100000];
  for(i=0;i<n;i++){
    b[i].x=c*a[i].x-s*a[i].y;
    b[i].y=s*a[i].x+c*a[i].y;
  }
  double ans=closestPairDistance(b,n);
  printf("%.9lf\n",ans);
  return;
}

int main(void){
  run();
  return 0;
}

