require 'complex'

N = gets.to_i
arr = N.times.map { gets.split.map(&:to_i) }

max_length = 0

[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  used = Array.new(N, false)

  now_point = [0, 0]
  arr.each_with_index do |next_, index|
    if next_[0] * x >= 0 && next_[1] * y >= 0
      now_point[0] += next_[0]
      now_point[1] += next_[1]
      used[index] = true
    end
  end


  while true
    flag = false
    arr.each_with_index do |next_, index|
      next if used[index]
      unless next_[0] * x >= 0 && next_[1] * y >= 0
        a_length = Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)
        b_length = Math.sqrt((now_point[0] + next_[0]) ** 2 + (now_point[1] + next_[1]) ** 2)

        if a_length < b_length
          now_point[0] += next_[0]
          now_point[1] += next_[1]
          flag = true
          used[index] = true
        end
      end
    end
    break if !flag
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end



[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  used = Array.new(N, false)

  now_point = [0, 0]
  arr.each_with_index do |next_, index|
    if next_[0] * x >= 0 && next_[1] * y >= 0
      now_point[0] += next_[0]
      now_point[1] += next_[1]
      used[index] = true
    end
  end


  while true
    flag = false
    arr.reverse.each_with_index do |next_, index|
      next if used[index]
      unless next_[0] * x >= 0 && next_[1] * y >= 0
        a_length = Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)
        b_length = Math.sqrt((now_point[0] + next_[0]) ** 2 + (now_point[1] + next_[1]) ** 2)

        if a_length < b_length
          now_point[0] += next_[0]
          now_point[1] += next_[1]
          flag = true
          used[index] = true
        end
      end
    end
    break if !flag
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end


arr = arr.sort_by { |x, y| Math.sqrt(x ** 2 + y ** 2) }

[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  used = Array.new(N, false)

  now_point = [0, 0]
  arr.each_with_index do |next_, index|
    if next_[0] * x >= 0 && next_[1] * y >= 0
      now_point[0] += next_[0]
      now_point[1] += next_[1]
      used[index] = true
    end
  end


  while true
    flag = false
    arr.reverse.each_with_index do |next_, index|
      next if used[index]
      unless next_[0] * x >= 0 && next_[1] * y >= 0
        a_length = Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)
        b_length = Math.sqrt((now_point[0] + next_[0]) ** 2 + (now_point[1] + next_[1]) ** 2)

        if a_length < b_length
          now_point[0] += next_[0]
          now_point[1] += next_[1]
          flag = true
          used[index] = true
        end
      end
    end
    break if !flag
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end

[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  used = Array.new(N, false)

  now_point = [0, 0]
  arr.each_with_index do |next_, index|
    if next_[0] * x >= 0 && next_[1] * y >= 0
      now_point[0] += next_[0]
      now_point[1] += next_[1]
      used[index] = true
    end
  end


  while true
    flag = false
    arr.each_with_index do |next_, index|
      next if used[index]
      unless next_[0] * x >= 0 && next_[1] * y >= 0
        a_length = Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)
        b_length = Math.sqrt((now_point[0] + next_[0]) ** 2 + (now_point[1] + next_[1]) ** 2)

        if a_length < b_length
          now_point[0] += next_[0]
          now_point[1] += next_[1]
          flag = true
          used[index] = true
        end
      end
    end
    break if !flag
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end

arr = arr.sort_by { |x, y| x / y }

[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  used = Array.new(N, false)

  now_point = [0, 0]
  arr.each_with_index do |next_, index|
    if next_[0] * x >= 0 && next_[1] * y >= 0
      now_point[0] += next_[0]
      now_point[1] += next_[1]
      used[index] = true
    end
  end


  while true
    flag = false
    arr.reverse.each_with_index do |next_, index|
      next if used[index]
      unless next_[0] * x >= 0 && next_[1] * y >= 0
        a_length = Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)
        b_length = Math.sqrt((now_point[0] + next_[0]) ** 2 + (now_point[1] + next_[1]) ** 2)

        if a_length < b_length
          now_point[0] += next_[0]
          now_point[1] += next_[1]
          flag = true
          used[index] = true
        end
      end
    end
    break if !flag
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end

[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  used = Array.new(N, false)

  now_point = [0, 0]
  arr.each_with_index do |next_, index|
    if next_[0] * x >= 0 && next_[1] * y >= 0
      now_point[0] += next_[0]
      now_point[1] += next_[1]
      used[index] = true
    end
  end


  while true
    flag = false
    arr.each_with_index do |next_, index|
      next if used[index]
      unless next_[0] * x >= 0 && next_[1] * y >= 0
        a_length = Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)
        b_length = Math.sqrt((now_point[0] + next_[0]) ** 2 + (now_point[1] + next_[1]) ** 2)

        if a_length < b_length
          now_point[0] += next_[0]
          now_point[1] += next_[1]
          flag = true
          used[index] = true
        end
      end
    end
    break if !flag
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end

puts max_length