#include <algorithm>
#include <vector>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iostream>

#define forn(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

struct pnt {
  int x, y;
};

bool xless( pnt a, pnt b ) { return a.x < b.x; }
bool yless( pnt a, pnt b ) { return a.y < b.y; }

typedef long long ll;

ll d2 = 8e18;

ll sqr( ll x ) { return x * x; }
void relax( pnt a, pnt b ) {
  ll tmp = sqr(a.x - b.x) + sqr(a.y - b.y);
  if (tmp < d2)
    d2 = tmp;
}

vector <pnt> q;
void go( int n, pnt *p ) {
  if (n <= 6) {
    forn(i, n)
      forn(j, i)
        relax(p[i], p[j]);
    sort(p, p + n, yless);
    return;
  }
  int m = n / 2, x = p[m].x;
  go(m, p);
  go(n - m, p + m);

  pnt tmp[n];
  merge(p, p + m, p + m, p + n, tmp, yless);
  memcpy(p, tmp, sizeof(tmp));

  q.clear();
  forn(i, n)
    if (sqr(p[i].x - x) < d2)
      q.push_back(p[i]);
  forn(i, q.size()) 
    for (int j = i + 1; j < (int)q.size() && sqr(q[j].y - q[i].y) < d2; j++)
      relax(q[i], q[j]);
}

ll solve( int n, pnt *p ) {
  d2 = 8e18;
  sort(p, p + n, xless);
  go(n, p);
  return d2;
}

ll solve2( int n, pnt *p ) {
  d2 = 8e18;
  forn(i, n)
    forn(j, i)
      relax(p[i], p[j]);
  return d2;
}

void main2() {
  int n;
  ios_base::sync_with_stdio(0);
  cin >> n;
  pnt p[n];
  forn(i, n)
    cin >> p[i].x >> p[i].y;
  printf("%.15f\n", sqrt(solve(n, p)));
}

int main() {
  main2();
  return 0;

  int n = 30, c = 10000;
  pnt p[n];

  for (int t = 0;; t++) {
    forn(i, n)
      p[i].x = rand() % c, p[i].y = rand() % c;

    int ja = solve2(n, p);
    int ca = solve(n, p);
    assert(ja == ca);
    if (t % 10000 == 0)
      cerr << t << endl;
  }
}