#0123 Medium Logic

Four people need to cross a dark bridge at night with only one flashlight. The bridge can hold at most two people at a time. Person A takes 1 minute, B takes 2 minutes, C takes 5 minutes, and D takes 10 minutes. They all get across in exactly 17 minutes. How?