CSES - Aalto Competitive Programming 2024 - wk2 - Wed - Cow heist
  • Time limit: 1.00 s
  • Memory limit: 512 MB

After an epic heist crew recruitment montage, a group of aliens is preparing to steal all the cows on Earth! There are nn cow farms on Earth and the ii-th farm has cic_i cows. The team needs to move swiftly, so they need to fine tune their ship's tractor beams. The ship has 3030 tractor beams and the ii-th tractor beam can be tuned to pull in exactly XiX_i cows. As a member of the crew your task is to tune the tractor beams in such a way that you can steal all the cows from any of the farms in a single pull.

Formally, for each ii in 1,2,,n1,2,\dots,n, there should be a subset of the tractor beams that can pull in exactly cic_i cows. If there are multiple answers, print any.

Input

The first line contains a single integer nn.

The next line contains nn integers c1,c2,,cnc_1,\,c_2,\cdots,\,c_n.

Output

Print 3030 integers X1 X2 X30X_1\ X_2 \dots\ X_{30} in a line.

Constraints

  • 1n1051 \leq n \leq 10^5
  • 1ci1061 \leq c_i \leq 10^6
  • 0Xi1060 \leq X_i \leq 10^6

Example 1

Input:

3
4 5 6

Output:

4 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Explanation:
The sets of beams that can be used to pull in the cows are: {1}\{1\} for farm 11, {1,2}\{1,\,2\} for farm 22 and {1,3}\{1,\,3\} for farm 33.

Example 2

Input:

6
4 2 3 10 7 1

Output:

 1 2 5 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Explanation:
The sets are {2,4}\{2,\,4\}, {2}\{2\}, {1,2}\{1,\,2\}, {1,2,3,4}\{1,\,2,\,3,\,4\}, {2,3}\{2,\,3\} and {1}\{1\}.