How chimpanzees solve collective action problems