WA : Game Of Robots

Problem : ROBOGAME Problem - CodeChef

My Solution : CodeChef: Practical coding for everyone

I tried a lot of test-cases manually , And it worked pretty well for those ; I cannot figure out the mistake , Please Help
!

Try test case

0…3

Your code prints unsafe while correct answer is safe.

Oh Thanks @taran_1407