#include<stdio.h>
#include<stdlib.h>
#include<opencv.hpp>
#include<Windows.h>
#include<opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
#define MAX 100
#define LONG 20
typedef struct {
short int row;
short int col;
}element;
element stack[MAX];
int top = -1;
int maze[LONG][LONG] =
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,0,1,0,0,0,1,1,0,1,0,0,0,1,1,1,1,1,0,0},
{1,0,0,1,1,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0},
{1,1,0,0,0,1,1,0,0,1,0,0,1,1,1,1,1,1,0,0},
{1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1},
{1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0},
{1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1},
{1,1,1,1,0,0,0,0,1,1,0,0,0,1,1,1,1,0,1,1},
{1,1,1,0,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,1},
{1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1},
{1,1,1,1,1,1