w,h,c=input().split() w,h=int(w),int(h) while len(c)