Money Sums#11504

Money Sums

1 second
128 megabytes
Easy

You have coins with given denominations. Find all sums that can be obtained using these coins.

Input

The first line contains one integer n~(1 \le n \le 100) — the number of coins.

The second line contains integers x_1, x_2, \ldots, x_n~(1 \le x_i \le 1000) — the denominations of the coins.

Output

In the first line, print the number of distinct sums that can be obtained.

In the second line, print all possible sums in increasing order.

Examples

Example 1

Loading
Loading