The Inescapable Maze

1000ms    65536K
370    143
Easier

Description

Jack and his friends were trapped in a maze of amusement park.  Please help them to find the right way to escape.

This square maze is reperented as 0,1 text.  0 is a way,  1 is a wall.  

The size of maze is N. The entrance at (1,1), the exit at (N,N).  You can only escape from exit.

Input

The first line contain three integers, N, x, y. (N<=80)

N is the size of maze.  x, y is the Jack and friends's current location.

Your task is to find the way from (x,y) to (N,N)

 

Output

If you find the way out,  print 'Found' then following with the maze model with '#' to show the way.

If you could't find the way, print 'Not Found'.

 

Sample Input

6 5 2
0 0 1 1 1 1
1 0 0 0 0 1
1 1 1 0 1 1
1 0 0 0 1 1
1 0 1 0 1 1
1 0 1 0 0 0

Sample Output

Found
0 0 1 1 1 1
1 0 0 # # 1
1 1 1 # 1 1
1 0 0 # 1 1
1 0 1 # 1 1
1 0 1 # # #

Hint

Assume the width of road is 1 char. (There is no 'wide' road in the maze)

Source

Editor

keefo on 2014-04-21 15:35:58


North University of China

OnlineJudge

NUC

NOJ

OJ

ACM/ICPC