WA in NOTALLFL

problem link: https://www.codechef.com/problems/NOTALLFL
Can anyone tell me what’s wrong with my code
my code in python:
https://www.codechef.com/viewsolution/29986760

It would be highly appreciated if someone points out the error in my code.