Squarks

No attempts yetTime limit2sMemory limit128 MB

Problem

A physicist named Byteasar is studying squarks, a newly discovered constituent of matter. Squarks are exotic particles that never exist alone but always in pairs, and a squark of one kind only ever pairs with a squark of a different kind.

After years of study he has established that there are nn different kinds of squarks. Each kind has a unique mass that is a positive integer multiple of some fixed unit. He has also measured the total mass of each of the n(n1)2\frac{n(n-1)}{2} possible pairs of two different kinds. According to the standard model, the mass of a pair equals the sum of the masses of the two squarks forming it.

Now he wants to determine the individual mass of each kind of squark. Write a program that reconstructs every mass configuration that is consistent with his measurements.

Input

The first line contains an integer nn (3n3003 \le n \le 300), the number of different kinds of squarks.

The second line contains the total masses of all n(n1)2\frac{n(n-1)}{2} possible pairs, separated by single spaces. All of them are positive integers, and the mass of each pair does not exceed 10810^8. For every two different kinds of squarks, the mass of the pair they form is given exactly once, in an arbitrary order.

In tests worth 32% of the points it additionally holds that n20n \le 20 and the mass of every pair does not exceed 2000.

Output

On the first line print the number kk of possible solutions. It is guaranteed that at least one solution exists for every input, so k>0k > 0.

On each of the following kk lines print one solution: the nn distinct positive integer masses of all kinds, in increasing order, separated by single spaces.

So that the answer is uniquely determined, print the kk solutions in lexicographically increasing order when each is compared as a sequence of integers.