Vova Escapes the Matrix

Problem Name:
Vova Escapes the Matrix
Site:CodeForces
Links:
Tags:
Problem setters: