How do I solve this problem-

Mr.A and Mr.B invested 1000 and 15000 dollers for a year in a project,after 6 months,Mr.C invests 12000 dollers for 6 months,after 6 months the whole profit from the project is 100000 dollers,I need to distribute the profit among these 3 according to their investment and time.so what will be the distributed profits.