
-- 139 f 

import Control.Monad
import Data.List
import Data.Maybe

func :: (Integer,Integer) -> ((Integer,Integer),(Integer,Integer),(Integer,Integer),(Integer,Integer),(Integer,Integer),(Integer,Integer)) -> ((Integer,Integer),(Integer,Integer),(Integer,Integer),(Integer,Integer),(Integer,Integer),(Integer,Integer))
func input result = 
    (i1,i2,i3,i4,i5,i6)
    where
        funcx x y
            | x < 0     = (( mx + x, mxy + y), (px,      pxy     ), (zxmy ,            zxpy ))
            | 0 < x     = (( mx,     mxy    ), (px + x , pxy + y ), (zxmy ,            zxpy ))
            | otherwise = (( mx,     mxy    ), (px,      pxy     ), (zxmy + (min 0 y), zxpy + (max 0 y)))
        funcy x y  
            | y < 0     = (( my + y, myx + x), (py,      pyx     ), (zymx ,            zypx ))
            | 0 < y     = (( my,     myx    ), (py + y , pyx + x ), (zymx ,            zypx ))
            | otherwise = (( my,     myx    ), (py,      pyx     ), (zymx + (min 0 x), zypx + (max 0 x)))
        ((mx,mxy),(px,pxy),(zxmy,zxpy),(my,myx),(py,pyx),(zymx,zypx)) = result
        (_x,_y) = input
        (i1,i2,i3) = funcx _x _y
        (i4,i5,i6) = funcy _x _y
 


main :: IO()
main = do

    n <- (read :: String -> Int)  <$> getLine

    arr <-  map ((map (read :: String -> Integer)).words) <$> replicateM n getLine

    let arr2 = map (\a -> (head a, (head.tail) a)) $ arr

    let ret = foldr func ((0,0),(0,0),(0,0),(0,0),(0,0),(0,0)) arr2

    let ((mx,mxy),(px,pxy),(zxmy,zxpy),(my,myx),(py,pyx),(zymx,zypx)) = ret
 
    let zxy = if 0 < (zxmy + zxpy)
        then
            zxpy
        else
            zxmy

    let zyx = if 0 < (zymx + zypx)
        then
            zypx
        else
            zymx

    let fzxy _xy    | _xy < 0   = zxmy
                    | 0 < _xy   = zxpy
                    | otherwise = zxy

    let fzyx _yx    | _yx < 0   = zymx
                    | 0 < _yx   = zypx
                    | otherwise = zyx


    let mxy2 = if 0 == mxy
        then
            zxy
        else
            mxy + (fzxy mxy)

    let pxy2 = if 0 == pxy
        then
            zxy
        else
            pxy + (fzxy pxy)

    let myx2 = if 0 == myx
        then
            zyx
        else
            myx + (fzyx myx)

    let pyx2 = if 0 == pyx
        then
            zyx
        else
            pyx + (fzyx pyx)

    let answer1 = ( mx * mx ) + ( mxy2 * mxy2 )
    let answer2 = ( px * px ) + ( pxy2 * pxy2 )
    let answer3 = ( my * my ) + ( myx2 * myx2 )
    let answer4 = ( py * py ) + ( pyx2 * pyx2 )

    print $ sqrt $ (fromIntegral :: Integer -> Double) $ maximum [answer1,answer2,answer3,answer4]

