The force of gravity on a 12 kg mass is always 12g = 12 x 9.81 = 117.72 N downwards.
There is an easy way to determine the acceleration downwards. It is called the generalized coordinate method. The gist of it is that the total inertial mass to be accelerated is 10 + 12 = 22 kg. The net unbalanced force on the combo of the two masses is the 117.72 N. From F = ma, we have
a = 117.2/22 = 5.35 m/s/s. This method works because the magnitude of the acceleration of the two masses is equal due to the string constraint.
This problem is a variant of Atwood's machine. There is a way to analyze it using free body diagrams and taking into account the tension in the string. The same answer for the acceleration results, but you also get the tension in the cord. See the hyperphysics site for more detail. (Just Google hyperphysics).