DRAW FIXING

I tried to solve the problem Draw Fixing from the IARCS Problem archieve ( http://www.iarcs.org.in/inoi/contests/nov2004/Advanced-1.php ) but is showing WA. The problem can have multiple solutions. Please help me find my error.

My code: