
# cood_1を中心としてcood_2を90度回転させるopは向き
def rotate(cood_1, cood_2, op)
  c_1 = Complex(cood_1[0], cood_1[1])
  c_2 = Complex(cood_2[0], cood_2[1])
  if op
    c_3 = (c_2 - c_1) * Complex(0,1) + c_1
  else
    c_3 = (c_2 - c_1) * Complex(0,-1) + c_1
  end
  return [c_3.real, c_3.imag]
end

# ２点から正方形の面積を計算する
def menseki(cood_1, cood_2)
  x = cood_1[0] - cood_2[0]
  y = cood_1[1] - cood_2[1]
  return x*x + y*y
end


loop do
  n = gets.to_i
  break if n == 0
  hashiras = Array.new(n) {gets.split(" ").map(&:to_i)}
  hash = {}
  hashiras.each {|h| hash[h] = true}
  res = 0
  0.upto(n-1) do |i|
    (i+1).upto(n-1) do |j|
      c_1 = hashiras[i]
      c_2 = hashiras[j]
      # 片方
      c_3 = rotate(c_1,c_2,true)
      c_4 = rotate(c_2,c_1,false)
      if hash[c_3] && hash[c_4]
        m = menseki(c_1, c_2)
        res = m if res < m
      end
      # もう片方
      c_3 = rotate(c_1,c_2,false)
      c_4 = rotate(c_2,c_1,true)
      if hash[c_3] && hash[c_4]
        m = menseki(c_1, c_2)
        res = m if res < m
      end
    end
  end
  puts res
end