A horse and a cow were sold for Rs. 3040 making a profit of 25% on the horse and 10% on the cow. By selling them for Rs. 3070 the profit realized would have been 10% on horse and 25% on the cow. Find the cost price of each.

A horse and a cow were sold for Rs. 3040 making a profit of 25% on the horse and 10% on the cow. By selling them for Rs. 3070 the profit realized would have been 10% on horse and 25% on the cow. Find the cost price of each.