codeforces#P92107. Labyrinth-7

Labyrinth-7

Description

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