Max Verstappen, Lewis Hamilton and Sergio Perez took the top three spots at the Mexico City Grand Prix.