INF = 1.0 / 0.0

def length(a, b)
  return Math.sqrt((b[0] - a[0])**2 + (b[1] - a[1])**2)
end

def closest_pair(pt)
  n = pt.size
  return INF if n == 1
  return length(pt[0], pt[1]) if n == 2
  m = n / 2
  x = pt[m][0]
  d = [closest_pair(pt[0..m]), closest_pair(pt[m..-1])].min

  sorted = []
  n.times{|i|
    sorted << i if (pt[i][0] - x).abs < d
  }
  m = sorted.size
  m.times{|i|
    (i+1).upto(m-1){|j|
      if (pt[sorted[i]][0] - x) * (pt[sorted[j]][0] - x) < 0
        it = length(pt[sorted[i]], pt[sorted[j]])
        break if it > d
        d = it
      end
    }
  }
  return d
end

n = gets.to_i
pt = []
n.times{|i|
  pt[i] = gets.split.map(&:to_f)
}

pt.sort!

puts closest_pair(pt)