Getting nzec error python

https://www.codechef.com/submit/XORNEY this python 3.6 code is showing runtime error nzec ,but not on idle

testing on ide is diff thing
ur code throws exception while taking input
it has something to do with test cases (may be extra spaces or something)
as i told u here

see if someone has got AC in py and check how they takes input