David had two bags A and B, container sugar. If he removed 2kg of sugar from bag A and added it to bag B, the mass of sugar in bag B would be four times the mass of the sugar in bag A. If he added 10kg of sugar to the original amount of sugar in each bag, the mass of sugar in bag B would be twice the mass of the sugar in bag A. Calculate the original mass of sugar in each bag.

original amounts,

A --- x kg
B --- y kg

after 1st scenario:
A --- x-2
B --- y+ 2
x+2 = 4(y-2)
x+2 = 4y - 8
x - 4y = -10 **

after 2nd scenario:
A --- x+10
B --- y+10
y+10 = 2(x+10)
y+10 = 2x + 20
2x - y = -10 ***

solve these two equations in x and y
I would change ** to x = 4y-10 and use substitution

To solve this problem, let's assign variables to the unknown quantities. Let's say the original mass of sugar in bag A is x kg, and the original mass of sugar in bag B is y kg.

According to the given information, if David removed 2kg of sugar from bag A and added it to bag B, the mass of sugar in bag B would be four times the mass of the sugar in bag A. This can be represented by the equation:

y + 2 = 4(x - 2)

If David then added 10kg of sugar to the original amount of sugar in each bag, the mass of sugar in bag B would be twice the mass of the sugar in bag A. This can be represented by the equation:

y + 10 = 2(x + 10)

Now we have a system of two equations:

1) y + 2 = 4(x - 2)
2) y + 10 = 2(x + 10)

To solve this system, we can use the method of substitution. Rearrange equation 1) to solve for y:

y = 4x - 8 - 2
y = 4x - 10

Now substitute this expression for y in equation 2):

4x - 10 + 10 = 2(x + 10)
4x = 2x + 20
2x = 20
x = 10

Substitute the value of x back into equation 1) to find y:

y = 4(10) - 10
y = 40 - 10
y = 30

Therefore, the original mass of sugar in bag A is 10 kg and the original mass of sugar in bag B is 30 kg.