Three partners shared the profit in a business in the ratio 5 : 7 : 8. They had partnership for 14 months, 8 months and 7 months respectively. What was the ration of their investments?