Getting nzec error python 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