5289

Problem ID: 5289

Copying the sample input from ACM-ICPC Live Archive messes up the formatting. Check the input on uDebug to see what the correct input format is like.