I need help trying to create an iterative formula to solve the following:

I have $10,000,000 that I need to split between 4 people in the following proportions

A - 10
B - 20
C - 30
D - 40

Half of what C receives will be paid back to me to redistribute to the 4 people in the same proportion(ie $1,500,000 in the first round). The same will happen again, I distribute in the same proportion and half of what C receives will be paid back to me until I have no money left to distribute and C no longer has anything to pay back to me.

Can anyone help? Thanks.