N=gets.chomp.to_i
ary=[]
N.times do
  ary << gets.chomp.split.map(&:to_i)
end

def squish ary
  x = ary.map(&:first).inject(&:+)
  y = ary.map(&:last).inject(&:+)
  if x.nil? || y.nil?
    []
  else
    [x,y]
  end
end

def distance coordiante
  return 0 if coordinate == []
  (coordiante.first**2 + coordiante.last**2)**0.5
end

a = ary.select{|attr| attr.all?(&:positive?)} # 第一象限
ary = ary - a
a = squish a
b = ary.select{|attr| attr.all?(&:negative?)} # 第三象限
ary = ary - b
b = squish b
c = ary.select{|attr| attr.first.positive? && attr.last.negative?)} # 第四象限
ary = ary - c
c = squish c
d = ary.select{|attr| attr.first.negative? && attr.last.positive?)} # 第二象限
ary = ary - d
d = squish d
e = ary.select{|attr| attr.first.positive? && attr.last.zero?} # x軸plus
ary = ary - e
e = squish e
f = ary.select{|attr| attr.first.negative? && attr.last.zero?} # x軸minus
ary = ary - f
f = squish f
g = ary.select{|attr| attr.last.positive? && attr.first.zero?} # y軸plus
ary = ary - g
g = squish g
h = ary.select{|attr| attr.last.negative? && attr.first.zero?} # y軸minus
h = squish h

pattern1 = squish [a,c,e,g]
pattern2 = squish [a,d,e,g]
pattern3 = squish [a,d,f,g]
pattern4 = squish [b,d,f,g]
pattern5 = squish [b,d,f,h]
pattern6 = squish [b,c,f,h]
pattern7 = squish [a,c,e,h]
pattern8 = squish [b,c,e,h]

distance1 = distance pattern1
distance2 = distance pattern2
distance3 = distance pattern3
distance4 = distance pattern4
distance5 = distance pattern5
distance6 = distance pattern6
distance7 = distance pattern7
distance8 = distance pattern8

puts [distance1,distance2,distance3,distance4,distance5,distance6,distance7,distance8].max