Bricks

No attempts yetTime limit3sMemory limit256 MB

Problem

Bitie and his friends spent all of yesterday playing with colored bricks at the kindergarten. They built models first, got bored with them, and then decided to lay the bricks out in one long line. To keep the line from looking dull they never put two bricks of the same color next to each other, and after a long while every brick was in place. The day care closed and the children went home.

Bitie came back early this morning and was glad to see the line still standing. Then he tripped and fell right onto it, and the bricks scattered into a pile. He sorted them by color and started thinking about how to rebuild the line quickly. He still remembers the colors of the two bricks that were at the ends.

You are given how many bricks Bitie has of each color and the two colors he remembers. Build a line in which neighboring bricks always have different colors, the first brick has color pp, and the last brick has color qq. Bitie may have remembered the colors wrong, or some bricks may have stayed lost after the fall, so the line cannot always be rebuilt.

Input

The first line contains the number of brick colors kk, the color of the first brick pp, and the color of the last brick qq, separated by single spaces. (1k1061 \le k \le 10^6, 1p,qk1 \le p, q \le k)

The second line contains kk integers i1,i2,,iki_1, i_2, \dots, i_k separated by single spaces. Bitie has exactly iji_j bricks of color jj. (1ij1061 \le i_j \le 10^6)

The total number of bricks n=i1+i2++ikn = i_1 + i_2 + \dots + i_k is at most 10610^6.

Output

Print the colors of the nn bricks in order on one line, separated by single spaces. The first color is pp, the last color is qq, and neighboring bricks have different colors.

When more than one line satisfies the conditions, print the lexicographically smallest one. When no line satisfies them, print the single integer 0.

Notes

To compare two lines AA and BB of the same length, look at the first position where their colors differ. The line with the smaller color number at that position comes first in lexicographic order.