let c1 is the money invested in the first account and c2 is the money invested in the second account.
So it is c1 + c2 = 18500 (1) the gain of the first accound after 1 year is 0.07c1 and the loss of the second
accound is -0.03c2 so it will be 0.07c1-0.03c2 = 1195 (2)
From the (1) we get c2=18500-c1 . plugging this value to (2) we get 0.07c1 -0.03(18500-c1)=1195
and 0.07c1-555+0.03c1=1195 --->>> 0.1c1=1195+555 --->>> 0.1c1 = 1750 --->>> c1=1750/0.1 = 17500
plugging this value of c1 to (1) we get 17500 + c2 = 18500 ---->>> c2= 18500-17500 = 1000
so c1=17500 $ money invested to first account and c2=1000€ invested to the second account