#P11679. Decapitated Carbon Creature

    ID: 13769 Type: Default 1000ms 256MiB

Decapitated Carbon Creature

Decapitated Carbon Creature

On planet Z, every carbon-based creature is represented as a string whose length is a multiple of \(3\). The string is divided into three equal parts: the first part represents the body, the second represents the head, and the third represents the eyes.

When the king beheads a creature, its head falls to the ground and its original order is disturbed. The second part (the head) moves to the beginning, the first part (the body) follows, and the third part (the eyes) remains at the end. In other words, if the original string is \(S\) of length \(N\) (a multiple of 3), then after decapitation, the creature is represented by the string:

\[ S_{\frac{N}{3}+1} S_{\frac{N}{3}+2} \dots S_{\frac{2N}{3}} \quad S_1 S_2 \dots S_{\frac{N}{3}} \quad S_{\frac{2N}{3}+1} S_{\frac{2N}{3}+2} \dots S_N \]

Your task is to compute the new string of the creature after being decapitated.

inputFormat

The input consists of a single string \(S\) whose length is a multiple of \(3\).

outputFormat

Print the new string after reordering it to the sequence: head, body, eyes.

sample

abcdefghi
defabcghi