Runtime(NZEC) error in submission of MARBLES problem

I was trying the MARBLES problem in the medium difficulty practise problems and even though my code seems to be running well, I am getting Runtime(NZEC)error on submission. Can somebody find the problem?
My solution:- Solution: 55562525 | CodeChef