P,Q,R enter into a partnership. P initially invests 25 lakh and adds another 10 lakh after one year. Q initially invests 35 lakh and withdraws 10 lakh after 2 years. R's investment is Rs 30 lakh. In what ratio should the profit be divided at the end of 3 years?