#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
const int N = 2e6 + 5;
const i64 INF = 1e15;
int n;
struct Point {
int x, y;
bool operator < (const Point &a) const {
if (x == a.x) return y < a.y;
return x < a.x;
}
} a[N];
inline i64 dist(int i, int j) {
i64 x = 1ll * (a[i].x - a[j].x) * (a[i].x - a[j].x);
i64 y = 1ll * (a[i].y - a[j].y) * (a[i].y - a[j].y);
return x + y;
}
inline bool cmp(const int &x, const int &y) {
return a[x].y < a[y].y;
}
int g[N];
i64 merge(int l, int r) {
if (l == r) return INF;
if (l + 1 == r) return dist(l, r);
int mid = l + r >> 1;
i64 d1 = merge(l, mid), d2 = merge(mid + 1, r);
i64 d = min(d1, d2);
int tot = 0;
for (int i = l; i <= r; ++i) {
i64 k = abs(a[mid].x - a[i].x);
if (k < INF && k * k < d) g[++tot] = i;
}
sort(g + 1, g + tot + 1, cmp);
for (int i = 1; i < tot; ++i)
for (int j = i + 1; j <= tot && 1ll * (a[g[j]].y - a[g[i]].y) * (a[g[j]].y - a[g[i]].y) < d; ++j)
d = min(d, dist(g[i], g[j]));
return d;
}
int main(void) {
ios::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i].x >> a[i].y;
sort(a + 1, a + n + 1);
cout << fixed << setpresision(10) << sqrt(merge(1, n)) << "\n";
return 0;
}