Solvable model for template coexistence in protocells.