N, M = map(int, input().split()) S = [input() for _ in range(N)] for i in range(N): bit = 0 for j in range(M): bit |= 1<