# https://github.com/tyuyu-62/cp-library def II(): return int(input()) def LI(dec=0): return [int(x) - dec for x in input().split()] def SI(): return input() def LS(): return list(input().split()) mod = 998244353 inf = 2002002002002002002 _buf = [] def print(*args, sep=" "): _buf.append(sep.join(map(str, args))) import io, os, sys input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline def solve(): mask = 2 ** 32 - 1 H, W = LI() S = [sum(LI()) for _ in range(H)] T = sum(S) for si in S: print((si + T) & mask) return if __name__ == "__main__": T = 1 # T = II() for _ in range(T): solve() sys.stdout.write("\n".join(_buf) + "\n")