L. The Bugs
time limit per test
5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

A submarine painted in bright plastic lemon color is investigating ocean depths and measuring the concentration of plastic yoctoparticles in the water. Each measurement (due to ingenious choice of the units) is a positive integer.

The measurement system is very recent, poorly tested and prone to errors. The project management suspects it is full of bugs. They find themselves in a time of trouble. Mother Mary also suspects it is full of bugs. Everybody cries: Help!

To identify and correct the bugs, they came together and decided to take the sequence of measured concentrations and analyze all triplets that occur in the sequence of measurements.

  • A triplet is a sequence of three integers.
  • Each triplet is associated with its characteristic.
  • The characteristic of a triplet $$$(x, y, z)$$$ is a triplet $$$(\operatorname{sgn}(y - x), \operatorname{sgn}(z - y), \operatorname{sgn}(z - x))$$$. The value of the sgn(x) function is $$$-1$$$, $$$0$$$ or $$$1$$$ for negative, zero or positive value of $$$x$$$, respectively.
  • A triplet $$$(x_1, y_1, z_1)$$$ is smaller than triplet $$$(x_2, y_2, z_2)$$$ if and only if the first nonzero value in the triplet $$$(x_1 - x_2, y_1 - y_2, z_1 - z_2)$$$ is negative.
  • The label of a triplet $$$T$$$ is the smallest triplet whose values are all positive and whose characteristic is equal to the characteristic of $$$T$$$.

A measured triplet is a triplet which is a subsequence of the measurement sequence. That is, the elements of the triplet appear in the measurement sequence in the same order they appear in the triplet, but in the sequence they do not necessarily follow each other.

Before they are analyzed, the measured triplets are grouped according to their labels. The management wants to know in advance the set of labels of all measured triplets.

Input

The first line contains one integer $$$N$$$ ($$$3 \leq N \leq 2 \cdot 10^5$$$), the number of measurements. The next line contains $$$N$$$ integers $$$x_1, x_2, \ldots , x_N$$$ ($$$1 \leq x_i \leq 10^9$$$), each representing one measurement.

Output

Print, in the increasing order, all different labels of all measured triplets which can be obtained from the given sequence of measurements, one per line. A label should be printed with no spaces between its consecutive elements.

Examples
Input
5
1 2 3 4 5
Output
123
Input
6
5 4 9 1 7 4
Output
121
132
211
212
213
231
312
321