#include<bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
char mp[maxn][maxn];
int vis[maxn][maxn];
int dir[4][2] = {0, 1, 1, 0, 0, -1, -1, 0};
struct node{
int x, y;
int step;
};
int bfs(int sx, int sy){
memset(vis, 0, sizeof(vis));
queue<n...