h,w=map(int,input().split()) for _ in range(h): s=list(input()) t=[] i=0 while i