Four people need to cross a bridge at night. They only have one torch, and the bridge is too dangerous to cross without it. The bridge can only hold two people at a time. The four people take different times to cross: 1 minute, 2 minutes, 7 minutes, and 10 minutes. How do they all get across in the shortest time possible?