You are given an n \times n matrix of integers. Your task is to identify a set of coordinates (k_i, l_i) such that each row index k_i and each column index l_i is used exactly once. The goal is to minimize the sum of the elements at these selected coordinates.
The input begins with a single integer (1 \leq n \leq 239). The next lines each contain integers. Each integer in the matrix is within the range -10^6 to 10^6.
The output should start with a single line containing the minimized sum. Following this, output lines, each containing a pair of numbers representing the selected cell coordinates, with the row number listed first.
Example 1