The Maximum Principle for Replicator Equations