SCU 2005' Warmup Contest 20

G: Necklace