#include <bits/stdc++.h>
using namespace std;
const int N = 35;
typedef pair<int, int> PII;
int n, m, times;
char g[N][N]; //存储地图
int d[N][N]; //存储距离 -1表示还未遍历
int dx[] = {0, -1, 0, 1}, dy[] = {1, 0, -1, 0};
void bfs(int sx, int sy)
{
queue<PII> q;
q.p...