a,b=map(int,input().split()) x=[input() for i in range(a)] y=[] def f(i,j,n,r): if x[i][j]=="o": n+=1 elif x[i][j]=="x": n-=1 else: return 0 r+=[[i,j,n]] if i==a-1 and j==b-1: if n>=0: y.append("A") #print(r) r=[] return 0 else: if n>=0: if i