#P1286. 两数之和

两数之和

Description

We know that taking any two from nn non-negative integers and adding them yields n(n1)2\frac{n(n-1)}{2} sums. Now, given these n(n1)2\frac{n(n-1)}{2} sums, determine the nn non-negative integers.

Input Format

The input contains multiple lines. Each line is one dataset, consisting of n(n1)2+1\frac{n(n-1)}{2} + 1 non-negative integers separated by spaces. The first number denotes nn (2<n<102 < n < 10). The remaining n(n1)2\frac{n(n-1)}{2} numbers are the pairwise sums. Each number does not exceed 100000100000. The file ends with EOF.

Output Format

Output multiple lines. For each input line, output one line that contains a set of nn non-negative integers in ascending order, separated by single spaces. If there is no solution, output Impossible.

3 1269 1160 1663

383 777 886

Hint

Translated by ChatGPT 5