codeforces#P92105. Labyrinth-5

Labyrinth-5

Description

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