Dream Team


The MAPS sports committee could not agree on which events to include in its relay, so it included all of them. Welcome to the NN-athlon: NN different legs, ranging from running and swimming to whatever sport the committee discovers next.

Your team has exactly NN people, numbered from 11 to NN. The legs must be completed in order from 11 to NN, with exactly one person completing each leg and each person competing exactly once. Person ii takes Ti,jT_{i,j} seconds to complete leg jj. Each leg starts as soon as the previous leg finishes, and changing competitors takes no time.

Everyone wants to compete in their favourite event. You would prefer to win. Choose an order for your team that minimises the total time needed to complete all NN legs.

Input

The first line contains an integer NN (1≤N≤101 \le N \le 10), the number of people and the number of legs.

Each of the next NN lines contains NN integers. The jj-th integer on the ii-th of these lines is Ti,jT_{i,j} (1≤Ti,j≤1061 \le T_{i,j} \le 10^6), the time in seconds that person ii takes to complete leg jj.

Output

Print NN space-separated integers p1,p2,…,pNp_1, p_2, \ldots, p_N, where pjp_j is the person assigned to leg jj. Every integer from 11 to NN must appear exactly once.

The sum Tp1,1+Tp2,2+⋯+TpN,NT_{p_1,1} + T_{p_2,2} + \cdots + T_{p_N,N} must be as small as possible. If several orders achieve the minimum total time, print any of them.

Example 1

Input 1
3
1 2 9
2 9 9
9 1 2
Output 1
2 1 3
Explanation

Assigning people 22, 11, and 33 to the three legs takes 2+2+2=62 + 2 + 2 = 6 seconds. Although person 11 is fastest at the first leg, assigning them there would prevent this minimum total.

Example 2

Input 2
1
7
Output 2
1
Explanation

There is only one person and one leg, so there is only one possible order.

Example 3

Input 3
2
5 5
5 5
Output 3
2 1
Explanation

Both orders take 1010 seconds. The order 1 2 would also be accepted.

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.