Coexistence of species competing for shared resources