cho.sh
Notes
Loading...

Number Selection Game

Time limit

2s

Memory limit

128 MB

Problem

You are given an integer NNN such that N=2kN = 2^kN=2k and 1≤k≤101 \le k \le 101≤k≤10. Then 2N−12N - 12N−1 integers are given.

Choose exactly NNN of the given numbers so that the sum of the chosen numbers is divisible by NNN. Print the chosen NNN numbers. If several answers are possible, print any one of them.

Input

The first line contains NNN.

The second line contains 2N−12N - 12N−1 integers. Each integer is between 000 and 100010001000, inclusive.

Output

On the first line, print NNN numbers separated by spaces whose sum is divisible by NNN.

If several answers are possible, print any one of them. If no such selection exists, print -1.