The extended answer set semantics for logic programs allows for the defeat of rules to resolve contradictions. We propose a refinement of these semantics based on a preference relation on extended literals. This relation, a strict partial order, induces a partial order on extended answer sets. The preferred answer sets, i.e. those that are minimal w.r.t. the induced order, represent the solutions that best comply with the stated preference on extended literals. In a further extension, we propose linearly ordered programs that are equipped with a linear hierarchy of preference relations. The resulting formalism is rather expressive and essentially covers the polynomial hierarchy. E.g. the membership problem for a program with a hierarchy of height n is ΣP n+1-complete. We illustrate an application of the approach by showing how it can easily express hierarchically structured weak constraints, i.e. a layering of “desirable” constraints, such that one tries to minimize the set of vi...