In this 3-way currency exchange, who loses, and by how much?
If the starting balances were

A = 1USD
B = 1.2EUR
C = 1000JPY
D = 1.5USD


then the ending balances are

A = 1.5USD
B = 1USD
C = 1.2EUR
D = 1000JPY


so the simple answer to where the 0.5USD came from is D.

A more complicated answer would be some combination of B, C and D depending on how the exchange rates rebalanced to iron out this arbitrage opportunity.

For example if 1000JPY dropped back to 1USD, then D could do some exchanges with B and C leaving them where they started and D with 1USD, i.e. D lost the 0.5USD

But if the EUR/JPY changed so that 1.8EUR = 1000JPY, then C ends up with -0.5USD, if you do exchanges to restore the JPY and EUR to where they started.

If USD/EUR changed so that 1.5USD = 1.2EUR, B ends up with -0.5USD.