  We consider extensions of the Einstein-Hilbert Lagrangian to a general
functional of metric and Riemann curvature tensor. A given such Lagrangian
describes two different theories depending on considering connection and metric
(Palatini formulation), or only the metric (metric formulation) as independent
dynamical degrees of freedom. Equivalence of the Palatini and metric
formulations at the level of equations of motion, which as we will argue is a
manifestation of the Equivalence Principle, is the physical criterion that
restricts form of the Lagrangians of modified gravity theories. We prove that
within the class of modified gravity theories we consider, only the Lovelock
gravity satisfies this requirement.
