Please Help me. Showing WA, please help me to find the error

https://www.codechef.com/viewsolution/33626108

It is not written anywhere that the direction in which you are going,is same as direction of train.

Thank You…