A trader bought two horses for Rs. 39,000. He sold one at a loss of 20% and another at a profit of 15%. If the selling price of each horse is the same, then what are their cost price respectively?