Close #4. Solve POJ 1003