Task about Appointment#4585

Task about Appointment

1 second
64 megabytes
Very easy

You are given a square matrix of natural numbers of order . Select elements from this matrix such that:

  1. Each row and each column contains exactly one selected element.

  2. Among all such selections, the sum of the selected numbers is minimized.

If there are multiple selections that satisfy these conditions, you may output any of them.

Input

The first line contains a natural number (1 \leq n \leq 200). Each of the following lines contains numbers. Each matrix element does not exceed .

Output

On the first line, output the minimum possible sum of the selected numbers. On the second line, output numbers: the -th number in this sequence should indicate the column number where the selected element is located in the -th row. This sequence should be a permutation of the numbers from to .

Examples

Example 1

Loading
Loading