temp = list(map(int, input().split())) n = temp[0] m = temp[1] for _ in range(m*(n+1)): input()