wa in The White Knight codechef easy

http://www.codechef.com/problems/E1/

my solution: http://ideone.com/jHk7eg
can somebody plz tell why it is giving wa again and again…???