Who did the Chinese lose territory to in exchange for help?