codeforces#P92108. Labyrinth-8

Labyrinth-8

Description

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