Efficient production#1268

Efficient production

10 seconds
122.812 megabytes
Medium

There are workers and jobs. The -th worker performs the -th job for a known amount of money. Find an assignment in which every worker performs exactly one job and the total cost of all assigned jobs is minimized.

Input

The input consists of several tests. The first line of each test contains a single natural number (2 \leq n < 14), the number of workers and jobs. Each of the next lines contains integers, where the -th number in the -th line is the cost for worker to perform job .

The cost of each job is non-negative and does not exceed .

Output

For each test case, output the minimal total cost on a separate line.

Examples

Example 1

Loading
Loading