Sequence Center

No attempts yetTime limit3sMemory limit256 MB

Problem

You are given kk integer sequences of length nn. The distance between sequences A=(a1,,an)A=(a_1,\ldots,a_n) and B=(b1,,bn)B=(b_1,\ldots,b_n) is d(A,B)=i=1naibid(A,B)=\sum_{i=1}^{n}|a_i-b_i|. Find an integer sequence CC that minimizes maxid(Ai,C)\max_i d(A_i,C) over the given sequences. Any optimal sequence is accepted.

Input

The first line contains nn and kk (2n1000002\le n\le 100000, 2k52\le k\le 5). Each of the next kk lines has nn integers, the absolute values are at most 10910^9.

Output

Print the nn integers of a center sequence separated by single spaces.