#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Jiahai has *N* baskets of apples, with the *i*th basket having a total of *A _{i}* apples. Since Jiahai is very neat, it is guaranteed that

*A*is in non-decreasing order.

He wishes to merge a certain subset of these baskets into a larger container. Given that the container will contain all the apples from the baskets Jiahai chooses, Jiahai wants to know, for each subset, what is the total number of apples he will find in the container.

Therefore, output a sorted list of the total number of apples in the container for each of the 2^{N} subsets Jiahai could possibly pick.

## Limits

Subtask 1 (20%): 1 ≤ N ≤ 2, 0 ≤ A_{i} ≤ 10^{5}.

Subtask 2 (80%): 1 ≤ N ≤ 20, 0 ≤ A_{i} ≤ 10^{5}.

Subtask 3 (0%): Sample Testcases.

## Input

The first line of input will contain one integer, *N*.

The second line of input will contain *N* integers, representing the array *A*.

## Output

The output should contain 2^{N} lines, with each line containing the total number of apples found for one possible subset. These integers should be printed in non-decreasing order.

## Sample Testcase 1

### Input

3 1 5 6

### Output

0 1 5 6 6 7 11 12

## Sample Testcase 2

### Input

3 3 4 5

### Output

0 3 4 5 7 8 9 12

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 20 | 20 | 3s | 256MB | Minimum |

2 | 80 | 42 | 3s | 256MB | Minimum |

3 | 0 | 2 | 3s | 256MB | Minimum |

### Judge Compile Command

g++-7 ans.cpp -o subsets -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512