x + 3 = 7
Both sides balance. Now strip away the extra weight.
The bag holds x — an unknown number of grams. Whatever you do to one pan you must do to the other, or it tips. Take the loose weights off both sides and the bag is left alone: that is the answer.