There are two boxes of candy with the same number of pieces. Put 8 pieces in the first box and take away 18 pieces from the second box. At this time, the amount of candy in the first box is three times that of the second box. How many pieces of candy are there in each of the two boxes? ?
有两盒块数一样的糖，第一盒放入8块，第二盒拿走18块，这时第一盒的糖是第二盒的3倍，这两盒原来各有多少块糖？
<gadget id="calculator">8 + 18</gadget>
<output>26</output>

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

<gadget id="calculator">26 / 2</gadget>
<output>13</output>

<gadget id="calculator">13 + 18</gadget>
<output>31</output>

<result>31</result>