SCU 2005' Warmup Contest 29

D: Daizi's path system