P, Q and R started a business in partnership. P invest Rs. 40,000, Q invests Rs. 80,000 and R Rs. 1,20,000 respectively. If Q withdraws Rs. 40,000 at the end of first year and R withdraws Rs. 80,000 at the end of the second year. At the end of three years,the profit will be shared in what ratio?