codeforces#P92102. Labyrinth-2

Labyrinth-2

Description

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