Comparative advantage and social protection