Since there is no diagram, I assume that there are jus two masses hanging on either side of a pulley - Atwood's Machine). Let h be the height that the 12 kg mass goes up (same distance 15 kg goes down:
Conservation of energy of the entire system is that the negative change in potential energy = change in kinetic energy
The negative change in potential is (mA-mB)gh
The change in kinetic energy = 1/2 (mA + mB) v2
Equate the 2 terms and solve for v in terms of h and the two masses.

Grigoriy S.
01/11/22