Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

11. Labyrinth-11
time limit per test
8 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

See the problem statement here: http://codeforces.com/contest/921/problem/01.