We classify all the six derivative Lagrangians of gravity, whose traced field equations are of second or third order, in arbitrary dimensions. In the former case, the Lagrangian in dimensions greater than six, reduces to an arbitrary linear combination of the six dimensional Euler density and the two linearly independent cubic Weyl invariants. In five dimensions, besides the independent cubic Weyl invariant, we obtain an interesting cubic combination, whose field equations for static spherically symmetric spacetimes are of second order. In the later case, in arbitrary dimensions we obtain two combinations, which in dimension three, are equivalent to the complete contraction of two Cotton tensors. Moreover, we also recover all the conformal anomalies in six dimensions. Finally, we present the general static, spherically symmetric solution for some of these Lagrangians.1 Note that the only non-quadratic term with degree of differentiation 4 is R, which is boundary term. 2 Since a divergenceless vector J a cannot be constructed locally out of the curvature, the equation ∇aJ a = 0, with J a := ∇ b −4aR ab + g ab 4a + D 2 b + 2(D − 1)c R , does not have any non-trivial solution.