Global rebalancing in a three-country model