Far far away, in an alien galaxy, ** M** friends decide to meet up and play the "Exploding Kittens" game. They all agreed upon how to pick the meetup location: they will all show up at the house of the alien friend which lives closest to everyone else.

Their world is not like the 3D space we are used to, because it has ** N** dimensions. They all live at integer coordinates in their world, meaning that a house location is an

**-dimensional vector of the form (x**

`N`_{1}, x

_{2}, …, x

_{n}), where x

_{1}, x

_{2}, …, x

_{n}are all integers. At any time, an alien can move from one position to another only if exactly one of the vector's components changes by 1 unit in absolute value. For example, in a 2D space, from a given position he can only move to the North, West, South or East directions in one step.

Your task is to compute the minimal number of steps needed for all friends to get to the meeting point. This will be a SUM(d_{i}), where d_{i} represents the minimal number of steps needed for the i-th friend to arrive at the meeting place, starting from his house. In addition to this, you should print the number of friends whose houses satisfy this minimal distance requirement and their houses' coordinates, in lexicographical order.

### Input

The first line of input contains integers ** M** and

**, separated by a space.**

`N`Each of the following

**lines contains**

`M`**integers, representing the coordinates of a house.**

`N`### Output

The first line of the output should contain the minimum total meeting distance, as described in the statement.

The next line should contain the number of houses ** H** for which the total meeting distance is minimal. The next

**lines should contain the coordinates of these houses. The houses should be sorted lexicographically.**

`H`### Constraints

`1 ≤ M ≤ 50000``1 ≤ N ≤ 25``1 ≤ N * M ≤ 250000`, where`10`^{-9}≤ x_{ij}≤ 10^{9}**x**is the j_{ij}^{th}coordinate of the i^{th}house

### Sample

Input | Output |
---|---|

2 25 5 1 1 | 82 1 1 5 5 |

We first observe that the problem is independent for each dimension.

Therefore we should solve the problem in a 1 dimensional space and the same principle applies to all dimensions.

For the 1D problem, we sort the elements in ascending order of the (only) coordinate and then we can use partial sums to the left and to the right to compute the manhattan distance from one point to all the others in ** O(M)** in total. We just need to take care that we add the manhattan distance to the correct initial point (as the order may differ when sorting on different axis).

Therefore the algorithm is

**or**

`O(N * M * logM)`**using the integer property of coordinates and radix / bucket sort.**

`O(N * M)`