def f(x): l, z = -1e9, 0 for lo, hi in sorted((cy-(r*r-(cx-x)**2)**.5, cy+(r*r-(cx-x)**2)**.5) for r, cx, cy in C if abs(x-cx)