Two baskets of apples are of the same weight, 16 kg is taken out from basket A, and 14 kg is added to basket B. At this time, the weight of apples in basket B is three times that of basket A. How many apples did A and B originally have?
两筐重量一样的苹果，甲筐取出16千克，乙筐加入14千克这时乙筐苹果的重量是甲筐的3倍．甲乙原来有苹果各是多少？
<gadget id="calculator">16 + 14</gadget>
<output>30</output>

<gadget id="calculator">3 - 1</gadget>
<output>2</output>

<gadget id="calculator">30 / 2</gadget>
<output>15</output>

<gadget id="calculator">15 + 16</gadget>
<output>31</output>

<result>31</result>