Two candles of equal height start to burn simultaneously. One of the candles is thicker than the other one and burns out in 4 hours, while the thinner one burns out in 2 hours. Both of the candles are extinguished after some time, and the remaining height of the thicker candle is now 3 times as long as the thinner one. How many minutes were the candles burning for?