R=range H,W=map(int,input().split()) S=[input()for i in R(H)] print(*([([H,s][s>0],[W,t][t>0])for i in R(H)for j in R(W)if'.'S[s][t]]+[("loop",)])[0])