Patterns of cooperation and exclusion