#include<iostream>
#include<vector>
using namespace std;
struct kor
{
    int x;
    int y;
};
int main()
{
    int n,m;
    cin>>n>>m;
    string Lebron[n];
    int a[n*m];
    kor steva;
    vector<kor> vatra;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(Lebron[i][j]=='.')
                a[i*m+j]=0;
            else if(Lebron[i][j]=='*')
                a[i*m+j]=1;
            else if(Lebron[i][j]=='X')
                {
                    a[i*m+j]=-1;
                    vatra.push_back({j,m});
                }
            else
                {
                    a[i*m+j]=0;
                    steva.x=j;
                    steva.y=i;
                }
        }
    }
    vector<vector<int>> g(n*m);
    

}