Little Bitie and his friends spent the whole yesterday playing with colorful bricks in the kindergarten.
Initially they made building models but they quickly got bored with that.
Then they decided to place the bricks in a line, one after another.
To avoid a dull look, they tried to avoid putting two bricks of the same color next to each other.
After a long while they succeeded in placing all the bricks while observing this rule.
Then the day care was over, and the children went home with their parents.
Today Bitie came to the kindergarten early.
He was satisfied to see that their yesterday's creation was still standing.
But then he tripped over in a most unfortunate way, falling right on the line of bricks, which all mixed in a pile.
The boy quickly sorted them by color and wondered how best to quickly reassemble the perfect line.
He managed to recall what were the colors of the two bricks on both end of the line.
Help little Bitie out and tell him how to order the bricks in a line so that no two bricks of the same color are next to each other and the bricks at the ends of the line have the colors that he recalled.
Note that Bitie could have made a mistake in recalling the two colors or perhaps he did not find some of the blocks after falling into them, so the reconstruction might not be possible.