If we read given question carefully, we get,
B+8 = C ---(i)
A-8 = C-3 ---(ii)
A+6 = 2D ---(iii)
B+D = 50 ---(iv)
Putting C = A -5 from (ii) into (i), we have :
B+8 = A-5 or A-B = 13 ---(v)
Putting D = 50-B from (iv) and (iii), we have :
A+6 = 100-2B or A+2B = 94 ---(vi)
Solving (v) and (vi), we get
B = 27 and A = 40