Buckling of tubular strings in curved wells