#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <fstream>
using namespace std;

ifstream fin("cmap.in");
ofstream fout("cmap.out");

pair < int, int > temp[100003];

int partition_x(pair < int, int > P[100003], int lo, int hi){
    int pivot = lo + (rand() % (hi - lo + 1));
    (P[0] = (P[pivot]), (P[pivot]) = (P[hi]), (P[hi]) = P[0]);
    pivot = hi;
    while(lo < pivot){
        if(P[lo].first >= P[pivot].first){
            (P[0] = (P[lo]), (P[lo]) = (P[pivot - 1]), (P[pivot - 1]) = P[0]);
            (P[0] = (P[pivot - 1]), (P[pivot - 1]) = (P[pivot]), (P[pivot]) = P[0]);
            -- pivot;
        }
        else{
            ++ lo;
        }
    }
    return pivot;
}

void qsort_x(pair < int, int > P[100003], int lo, int hi){
    if(lo >= hi){
        return;
    }
    int pivot = partition_x(P, lo, hi);
    qsort_x(P, lo, pivot - 1);
    qsort_x(P, pivot + 1, hi);
    return;
}

bool cmp_y(pair < int, int > a, pair < int, int > b){
    return a.second < b.second;
}

long long closest_dist(pair < int, int > P[100003], int lo, int hi){
    if(hi - lo == 0){
        return 1e18;
    }
    if(hi - lo == 1){
        if(P[lo].second > P[hi].second){
            (P[0] = (P[lo]), (P[lo]) = (P[hi]), (P[hi]) = P[0]);
        }
        return (1ll * (1ll *(P[lo].first - P[hi].first) * (P[lo].first - P[hi].first) + 1ll *(P[lo].second - P[hi].second) * (P[lo].second - P[hi].second)));
    }
    int mid = (lo + hi) / 2,
        xmid = P[mid].first;
    long long left = closest_dist(P, lo, mid),
                right = closest_dist(P, mid + 1, hi),
                d = ((left) < (right) ? (left) : (right));
    merge(P + lo, P + mid + 1, P + mid + 1, P + hi + 1, temp, cmp_y);
    copy(temp, temp + hi - lo + 1, P + lo);
    int nl = 0, nr = 50000;
    for(int i = 0, n = hi - lo + 1; i < n; i ++){
        P[lo + i] = temp[i];
        if((1ll * (xmid - temp[i].first) * (xmid - temp[i].first)) < d){
            if(xmid - temp[i].first >= 0){
                temp[nl ++] = temp[i];
            }
            else{
                temp[nr ++] = temp[i];
            }
        }
    }
    int il = 0, ir = 50000;
    while(il < nl && ir < nr){
        if(temp[il].second < temp[ir].second){
            for(int i = ir; (1ll * (temp[il].second - temp[i].second) * (temp[il].second - temp[i].second)) < d && i < nr; i ++){
                d = ((d) < ((1ll * (1ll *(temp[il].first - temp[i].first) * (temp[il].first - temp[i].first) + 1ll *(temp[il].second - temp[i].second) * (temp[il].second - temp[i].second)))) ? (d) : ((1ll * (1ll *(temp[il].first - temp[i].first) * (temp[il].first - temp[i].first) + 1ll *(temp[il].second - temp[i].second) * (temp[il].second - temp[i].second)))));
            }
            ++ il;
        }
        else{
            for(int i = il; (1ll * (temp[ir].second - temp[i].second) * (temp[ir].second - temp[i].second)) < d && i < nl; i ++){
                d = ((d) < ((1ll * (1ll *(temp[ir].first - temp[i].first) * (temp[ir].first - temp[i].first) + 1ll *(temp[ir].second - temp[i].second) * (temp[ir].second - temp[i].second)))) ? (d) : ((1ll * (1ll *(temp[ir].first - temp[i].first) * (temp[ir].first - temp[i].first) + 1ll *(temp[ir].second - temp[i].second) * (temp[ir].second - temp[i].second)))));
            }
            ++ ir;
        }
    }
    return d;
}

int main(){
    int n;
    pair < int, int > P[100003];
    fin>>n;
    for(int i = 1; i <= n; i ++){
        fin>>P[i].first>>P[i].second;
    }
    qsort_x(P, 1, n);
    fout<<fixed<<setprecision(6)<<sqrt(closest_dist(P, 1, n))<<"\n";
 return 0;
}