Let A, B, and C be the amounts invested in companies A, B, and C.