// AOJ CGL_5_A Closest Pair
// 2018.5.3 bal4u

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

typedef struct { double x, y; } PP;

#define INF     1e8
#define EPS     1e-8

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

double dbl()
{
	int minus = 0;
	double x, y;
	int n = 0, c = gc();
	if (c == '-') minus = 1, c = gc();
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');

	if (c == '.') {
		x = 0;
		y = 1, c = gc();
		do y *= 0.1, x += y * (c & 0xf), c = gc(); while (c >= '0');
		x += n;
	} else x = n;
	if (minus) x = -x;
	return x;
}

PP L[100002], R[100002];

int dcmp(double x) { if (fabs(x) < EPS) return 0; return x <= 0 ? -1 : 1; }
int cmp(PP *a, PP *b) { return dcmp(a->x - b->x); }

void merge(PP *p, int low, int mid, int high)
{
	int n1, n2, i, j, k;

	n1 = mid-low, n2 = high-mid;
	memcpy(L, p+low, sizeof(PP)*n1);
	memcpy(R, p+mid, sizeof(PP)*n2);
	L[n1].y = R[n2].y = INF;

	i = 0, j = 0;
	for (k = low; k < high; k++) {
		if (L[i].y <= R[j].y) p[k] = L[i++];
		else                  p[k] = R[j++];
	}
}

double closest_pair(int n, PP *p)
{
	int m, i, j, t;
	double ans, d, x;

	if(n <= 1) return INF;
	m = n >> 1;
	x = p[m].x;
	ans = closest_pair(m, p);
	d   = closest_pair(n-m, p+m);
	if (d < ans) ans = d;
	merge(p, 0, m, n);

	t = 0;
	for (i = 0; i < n; i++) {
		if (fabs(p[i].x - x) >= ans) continue;

		for (j = 0; j < t; j++) {
			double dx = p[i].x - L[t-1-j].x;
			double dy = p[i].y - L[t-1-j].y;
			if (dy >= ans) break;
			d = hypot(dx, dy);
			if (d < ans) ans = d;
		}
		L[t++] = p[i];
	}
	return ans;
}

PP p[100002];

int main()
{
	int n, i;

	n = in();
	for (i = 0; i < n; i++) p[i].x = dbl(), p[i].y = dbl();
	qsort(p, n, sizeof(PP), cmp);
	printf("%.10lf\n", closest_pair(n, p));
	return 0;
}

