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, s, e)
  return INF if e - s < 1
  return length(pt[s], pt[e]) if e - s == 1
  m = (e + s) / 2
  x = pt[m][0]
  d = [closest_pair(pt, s, m), closest_pair(pt, m, s)].min
  sorted = pt[s..e].sort{|a, b| a[1] <=> b[1]}
  tmp = []
  sorted.size.times{|it|
    next if ((sorted[it][0] - x).abs >= d)
    (tmp.size-1).downto(0){|i|
      dx = sorted[it][0] - tmp[i][0]
      dy = sorted[it][1] - tmp[i][1]
      break if dy >= d
      d = [d, Math.sqrt(dx*dx+dy*dy)].min
    }
    tmp << sorted[it]
  }
  return d
end

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

pt.sort!

puts closest_pair(pt, 0, n-1)