N, M = map(int, input().split()) I = [list(map(int, input())) for i in range(N)]