# 2020 USACO January Bronze

# Photoshoot

Farmer John is lining up his **n** cows numbered **1** ... **n** for a photoshoot. FJ initially planned for the **i**-th cow from the left to be the cow numbered `a`

, and wrote down the permutation _{i}`a`

, _{1}`a`

,..., _{2}`a`

on a sheet of paper. Unfortunately, that paper was recently stolen by Farmer Nhoj!_{n}

Luckily, it might still possible for FJ to recover the permutation that he originally wrote down. Before the sheet was stolen, Bessie recorded the sequence `b`

, _{1}`b`

, ...,_{2}`b`

that satisfies _{n−1}`b`

= _{i}`a`

+ _{i}`a`

for each _{i+1}**i** (**1** ≤ **i** < **n**).

Based on Bessie's information, help FJ restore the "lexicographically minimum" permutation a that could have produced **b**. A permutation **x** is lexicographically smaller than a permutation **y** if for some **j**, `x`

= _{i}`y`

for all _{i}**i** < **j** and `x`

< _{j}`y`

(in other words, the two permutations are identical up to a certain point, at which _{j}**x** is smaller than **y**). It is guaranteed that at least one such a exists.

#### Input

The first line contains a single integer **n** (**2** ≤ **n** ≤ `10`

). The second line contains ^{3}**n** − **1** space-separated integers `b`

, _{1}`b`

, ...,_{2}`b`

._{n−1}

#### Output

Print the lexicographically minimum permutation `a`

, _{1}`a`

,..., _{2}`a`

._{n}

#### Explanation

**a** produces **b** because **3** + **1** = **4**, **1** + **5** = **6**, **5** + **2** = **7** and **2** + **4** = **6**.

5 4 6 7 6

3 1 5 2 4