#include <iostream>
#include <cstdio>
#include <math.h>
#include <cstring>
#include <algorithm>
using namespace std;
#define inf 0x3f3f3f3f
const int MAXN=100005;
struct dots
{
double x,y;
}point[MAXN];
int index[MAXN];
bool cmpx(dots a,dots b){
return a.x<b.x;
}
bool cmpy_idx(int a,int b){
return point[a].y<point[b].y;
}
inline double dis(dots a, dots b){
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
inline double min(double a, double b){
return a<b?a:b;
}
double close_pair(int left,int right){
if(left == right ) return inf;
if(left + 1 == right ) return dis(point[left],point[right]);
int mid = (left + right) >> 1;
double ans = min(close_pair(left,mid) , close_pair(mid+1,right));
int cnt=0;
for(int i = left ;i <= right ; i++)
if( point[i].x <= point[mid].x + ans && point[i].x >= point[mid].x - ans)
index[++cnt]=i;
sort(index+1,index+1+cnt,cmpy_idx);
for(int i = 1; i <= cnt ; i++){
for(int j= i+1 ;j <= cnt ; j++){
if(point[index[j]].y - point[index[i]].y >= ans) break;
ans = min(ans, dis( point[index[j]] , point[index[i]] ) );
}
}
return ans;
}
void inint(int number){
for(int i=1;i <=number ;i++){
scanf("%lf%lf",&point[i].x,&point[i].y);
}
sort(point+1,point+1+number,cmpx);
}
int main(){
int N;
while(cin>>N,N!=0){
inint(N);
double ans=close_pair(1,N);
printf("%.2lf\n",ans);
}
return 0;
}