A, B and C enter into a partnership. They invest Rs. 40000, Rs. 80000 and Rs. 120000 respectively. At the end of the first year, B withdraws Rs. 40000, while at the end of the second year, C withdraws Rs. 80000. In what ratio will the profit be shared at the end of 3 years ?