using System; using System.Collections; using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ found=false; int i0=-1;int j0=-1; for(int i=0;i=0 && j+offj=0){ brd[i,j]=true; if(S[i+offi][j+offj]=='.')return; brd[i+offi,j+offj]=true; }else{ return; } } } if(chk)found=true; } bool found; int N,M; String[] S; public Sol(){ var d=ria(); N=d[0];M=d[1]; S=new String[N]; for(int i=0;iint.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }