D. DnD Dice
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

In Dungeons & Dragons (DnD) and many other role playing games, many actions are determined by dice rolls, and it is also quite common to use dice with different numbers of sides. The most common dice are those based on the five Platonic solids, the tetrahedron, cube, octahedron, dodecahedron and icosahedron, with $$$4$$$, $$$6$$$, $$$8$$$, $$$12$$$ and $$$20$$$ sides, respectively. In DnD terminology, these dice are usually called d4, d6, d8, d12 and d20.

As a dungeon master, you are currently designing a campaign for your group of players. In the final battle of this campaign, the players need to roll a combination of multiple dice with varying numbers of sides, and the action of the enemy is determined by the sum of the numbers on the dice that were rolled. For balancing purposes, you want to sort these sums based on how likely they are to occur, so that you can assign appropriate events to each of them.

Given the number of dice of each type, and assuming the sides of each die are numbered from $$$1$$$ to the number of sides, find all possible sums of dice rolls and output them sorted by non-increasing probability.

Input

The input consists of:

  • One line with five integers $$$t$$$, $$$c$$$, $$$o$$$, $$$d$$$ and $$$i$$$, ($$$0 \le t, c, o, d, i \le 10$$$), giving the number of tetrahedra, cubes, octahedra, dodecahedra and icosahedra among the dice that are rolled. There is always at least one die, that is $$$t+c+o+d+i \ge 1$$$.
Output

Output all possible sums, ordered from most likely to least likely. If two sums occur with the same probability, then those sums may be printed in any relative order.

Examples
Input
1 1 1 0 0
Output
11 10 9 12 8 13 14 7 15 6 5 16 17 4 18 3
Input
2 0 0 1 0
Output
9 14 12 11 10 13 15 8 16 7 6 17 5 18 4 19 3 20
Input
0 0 0 0 1
Output
10 3 9 8 14 13 11 7 6 12 20 4 15 5 16 1 2 19 17 18