-- 139 f 

import Control.Monad
import Data.List

solve :: Int -> [(double,Integer,Integer)] -> [(double,Integer,Integer)] -> Integer -> Integer -> Integer -> Integer -> [Integer] -> [Integer]
solve n [] [] sx1 sy1 sx2 sy2 results = results

solve n p1@((a1,x1,y1):xs1) [] sx1 sy1 sx2 sy2 results  =
    solve n xs1 [] nextsx1 nextsy1 sx2 sy2 (new_dis1 : results)
    where
        nextsx1 = sx1 + x1
        nextsy1 = sy1 + y1
        new_dis1 = ((nextsx1 - sx2) * (nextsx1 - sx2)) + ((nextsy1 - sy2) * (nextsy1 - sy2))

solve n [] p2@((a2,x2,y2):xs2) sx1 sy1 sx2 sy2 results  =
    solve n [] xs2 sx1 sy1 nextsx2 nextsy2 (new_dis2 : results)
    where
        nextsx2 = sx2 + x2
        nextsy2 = sy2 + y2
        new_dis2 = ((sx1 - nextsx2) * (sx1 - nextsx2)) + ((sy1 - nextsy2) * (sy1 - nextsy2))

solve n p1@((a1,x1,y1):xs1) p2@((a2,x2,y2):xs2) sx1 sy1 sx2 sy2 results  
    | old_dis < new_dis1 =
        solve n xs1 p2  nextsx1 nextsy1 sx2     sy2     (new_dis1:results)
    | old_dis < new_dis2 =
        solve n p1  xs2 sx1     sy1     nextsx2 nextsy2 (new_dis2:results)
    | n <= (length p2) - (length xs1) =
        solve n p1  xs2 sx1     sy1     nextsx2 nextsy2 (new_dis2:results)
    | otherwise =
        solve n xs1 p2  nextsx1 nextsy1 sx2     sy2     (new_dis1:results)
    where
        nextsx1 = sx1 + x1
        nextsy1 = sy1 + y1
        nextsx2 = sx2 + x2
        nextsy2 = sy2 + y2
        old_dis =  ((sx1 - sx2) * (sx1 - sx2)) + ((sy1 - sy2) * (sy1 - sy2))
        new_dis1 = ((nextsx1 - sx2) * (nextsx1 - sx2)) + ((nextsy1 - sy2) * (nextsy1 - sy2))
        new_dis2 = ((sx1 - nextsx2) * (sx1 - nextsx2)) + ((sy1 - nextsy2) * (sy1 - nextsy2))

main :: IO()
main = do

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

    arr <-  replicateM n $ do
        line <- getLine
        let [x,y] = map (read :: String -> Integer) $ words line
        return (atan2 (fromIntegral y) (fromIntegral x) :: Double, x, y)

    let func item = a where (a,x,y) = item 

    let arr2 = sortOn func arr

    let arr3 = concat [arr2,fst $ span (\(a,_,_) -> a <= 0) arr2]

    let arr4 = solve n arr3 arr3 0 0 0 0 []

    print $ sqrt $ (fromIntegral :: Integer -> Double) $ maximum arr4

