For $A,\, 40\, g \stackrel{20 s }{\longrightarrow} 20 g \stackrel{20 s }{\longrightarrow} 10 g$
For $B,\, 160\, g \stackrel{10 s }{\longrightarrow} 80 g \stackrel{10 s }{\longrightarrow} 40 g \stackrel{10 s }{\longrightarrow} 20 g \stackrel{10 s }{\longrightarrow} 10 g$