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.
(160 + 180) * 8 + 180 * 4 = ? * 4 + (? + 160) * 8.
==> 3440 = ? * 4 + (? + 160) * 8.
==> Write without parentheses: 3440 = ? * 4 + ? * 8 + 160 * 8.
==> Simplify: 3440 = ? * (4 + 8) + 1280.
==> 3440 - 1280 = ? * 12.
==> (3440 - 1280) / 12 = ?.
==> ? = 180