The scale is balanced. This is the case if the distances * weights are the same on both sides of the scale: (A + B) * weigth 1 + B * weight 2 = C * weigth 3 + (C + D) * weight 4.
(200 + 160) * 4 + 160 * ? = 180 * 8 + (180 + 140) * 2.
==> 1440 + 160 * ? = 2080.
==> 160 * ? = 2080 - 1440.
==> ? = (640 / 160.
==> ? = 4.