    n = gets.chomp.to_i

    o = [0, 0]
    p = [0, 0]
    q = [0, 0]

    r = [0, 0]
    s = [0, 0]
    t = [0, 0]
    for i in 1..n
        x, y = gets.chomp.split(/\s/).map{|x| x.to_i}
        next if x == 0 and y == 0

        if x >= 0 and y >= 0
            o[0] += x
            o[1] += y
        end

        if x >= 0
            p[0] += x
            p[1] += y
        end

        if x < 0
            q[0] += x
            q[1] += y
        end

        if x <= 0 and y <= 0
            r[0] += x
            r[1] += y
        end

        if y >= 0
            s[0] += x
            s[1] += y
        end

        if y < 0
            t[0] += x
            t[1] += y
        end
    end

    puts [Math.sqrt(o[0]*o[0] + o[1]*o[1]),
    Math.sqrt(p[0]*p[0] + p[1]*p[1]),
    Math.sqrt(q[0]*q[0] + q[1]*q[1]),

    Math.sqrt(r[0]*r[0] + r[1]*r[1]),
    Math.sqrt(s[0]*s[0] + s[1]*s[1]),
    Math.sqrt(t[0]*t[0] + t[1]*t[1])].max