Interactive programming question in September long challenge (FINXOR)

I am a beginner in interactive programming and this was my first problem where I tried it.
my solution code using python 3 is:
https://www.codechef.com/viewsolution/37705280

The compiler said wrong answer, can anyone help me to find reason.

Thanks

need help.