// AOJ CGL_5_A Closest Pair
// 2018.5.3 bal4u

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

typedef struct { double x, y; } PP;

#define INF     1e12
#define EPS     1e-7
#define RANGE	4
#define SIN     0.70710678118654752440084436210485    // Sin(45)
#define COS     0.70710678118654752440084436210485    // Cos(45)
#define SINCOS  SIN

#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;
}

int cmp(PP *a, PP *b)
{
	if (fabs(a->x - b->x) < EPS) {
		if (fabs(a->y - b->y) < EPS) return 0;
		if (a->y < b->y) return -1; return 1;
	}
	if (a->x < b->x) return -1;	return 1;
}

PP p[100010];

int main()
{
	int n, i, j, lim;
	double x, y, t, ans;

	n = in();
	for (i = 0; i < n; i++) {
		x = dbl(), y = dbl();
		p[i].x = (x - y) * SINCOS;
		p[i].y = (x + y) * SINCOS;
	}

	qsort(p, n, sizeof(PP), cmp);

	ans = INF;
	for (i = n; i < n+RANGE; i++) p[i].x = INF, p[i].y = 0;
	for (i = 0; i < n; i++) {
		lim = i+RANGE; for (j = i+1; j < lim; j++) {
			t = hypot(p[i].x-p[j].x, p[i].y-p[j].y);
			if (t < ans) ans = t;
		}
	}
	printf("%.10lf\n", ans);
	return 0;
}

