Suppose A gets ₹ P and B gets ₹ (25000 - P).
Interest received by A at the rate of 8% per annum CI
= P(1 + 8/100)2 - P
= P(27/25)2 - P
= 104P/625
Interest received by B at the rate of 10% per annum SI
= [(25000 - P) x 10 x 2]/100 = (25000 - P)/5
According to the question,
(25000 - P)/5 = 104P/(625 + 1336)
∴ P = 10000