For two ropes of the same length, cut off 40 cm from the first and 12 cm from the second, and the length of the remaining part of the second is three times that of the remaining part of the first. How long are the two ropes in centimeters?
两根一样长的绳子，第一根剪去40厘米，第二根剪去12厘米，第二根剩下部分的长度是第一根剩下部分的3倍．两根绳子原来长多少厘米？
<gadget id="calculator">40 - 12</gadget>
<output>28</output>

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

<gadget id="calculator">28 / 2</gadget>
<output>14</output>

<gadget id="calculator">14 + 40</gadget>
<output>54</output>

<result>54</result>