#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
#define N 60005
#define pa pair <double, double>
#define fi first
#define se second
pa node[N], s[N];
int top = 0;
int n;
double sqr(double x){
return x * x;
}
double dis(int x, int y){
return sqrt(sqr(node[x].fi - node[y].fi) + sqr(node[x].se - node[y].se));
}
int main(){
freopen("nearest.in", "r", stdin);
freopen("nearest.out", "w", stdout);
scanf("%d", &n);
for (int i = 1; i <= n ; i++){
scanf("%lf%lf", &node[i].fi, &node[i].se);
}
double ans = 1000000000000000000000000.0;
sort(node + 1, node + 1 + n);
for (int i = 1; i <= n; i ++){
for (int j = i - 1; j >= max(1, i - 3); j --) {
if (i == j) continue;
ans = min(ans, dis(i, j));
}
}
printf("%.4lf\n", ans);
return 0;
}