NZEC error python 3

I was solving ALETHIO problem using python 3 but it continuously gave me NZEC error. Tried try-finally statement, removing any whitespace in the input; but nothing worked. Please help me.
http://www.codechef.com/viewsolution/2313273

//