  This paper is devoted to the construction of new type of f(R) theories of
gravity that are based on the principle of detailed balance. We discuss two
versions of these theories with and without the projectability condition.
