Let the Cost Price (C.P.) of the first shirt be ₹x and the C.P. of the second shirt be ₹910 - x.
For the first shirt, selling it at a profit of 16% means Selling Price (S.P.) = 1.16x.
For the second shirt, selling it at a loss of 12% means Selling Price (S.P.) = 0.88(910 - x).
Since there is no overall gain or loss in the whole transaction, the total S.P. must be equal to the total C.P. Hence,
1.16x + 0.88(910 - x) = 910
Expanding and rearranging the equation gives:
1.16x + 800.8 - 0.88x = 910
0.28x = 109.2
x = 390
Thus, the C.P. of the first shirt is ₹390 and the C.P. of the second shirt is ₹910 - 390 = ₹520.
Therefore, the C.P. of the two shirts are ₹390 and ₹520 respectively.