Brazil wins Confederations Cup