X, Y and Z enter into a partnership. They invest Rs. 40,000, Rs. 80,000 and Rs. 1,20,000 respectively. At the end of the first year, Y withdraws Rs. 40,000, while at the end of the second year, Z withdraws Rs. 80,000. IN what ratio will the profit be shared at the end of 3 years?