The question is wrong because all bodies apply only attractive gravitational force so if the diagram is:
A ------------------ B ------------- C
8m 6m
then the net force apllied by A and B at C cannot be equal to zero , because both A & B will pull C toward direction of A . If A is pulling C then B is pushing C only then can force be zero , but that can never happen as both can only pull.
So you must check if you have correctly typed your question.
If C is between A and B
A---------------C--------------B
2m 6m
then
If weight of body placed in between be m1.
Force between 2 bodies is given by (G*m1*m2)/(r2)
So gravitational force between m1 and 24kg = ( G*(24)*m1)/((2)2)
force between m1 and m = (G*m1*m)/((6)2)
for net force to be 0 the above two forces should be equal
(G*(24)*m1)/((2)2)=( G*m1*m)/((6)2)
m = (36)(24)/4 = 216 kg