Alice the Fox and Basil the Cat ran away from Pinocchio but left him a cube. They said that it has written on it where the treasure is buried. Of course, he believed them.
A digit was burned on each face of the cube.
Pinocchio was told that he needs to move along the faces of the cube, transitioning to a neighboring face each time and recording the digits that are drawn on them. He can enter each face only once.
The largest number that can be collected in this way will indicate where the treasure is buried. The first three digits represent steps to the north from the old mill, and the rest represent steps to the east.
Help Pinocchio find the largest number that can be obtained in the specified way. After all, he wants to check if what he was told is true.
The first line contains $$$6$$$ integers $$$d_1, \ldots, d_6$$$ $$$(0 \le d_i \le 9)$$$ — the digits burned on the top, bottom, left, right, front, and back faces of the cube, respectively.
It is guaranteed that at least one of the digits $$$d_i$$$ is different from $$$0$$$.
In the first line, output a single integer $$$X$$$ $$$(10^5 \le X \lt 10^6)$$$ — the largest number that can be obtained in the way described by Pinocchio.
2 3 1 4 5 6
645312
First test example
The maximum number $$$645312$$$ can be obtained by traversing the faces of the cube in the following order:
Note that the following numbers cannot be obtained:
| Name |
|---|


