#C6717. Next State in Lavaland

    ID: 50508 Type: Default 1000ms 256MiB

Next State in Lavaland

Next State in Lavaland

In Lavaland, every cell in the landscape can be in one of two states: V (volcanic rock) or L (lava rock). The transformation rule is as follows:

  • A cell already in state V remains unchanged.
  • A cell in state L will change to V if at least one of its adjacent cells (either to the left or right) is in state V.

Your task is to compute the next state of Lavaland given an initial state represented as a string. Note that the transformation is applied simultaneously based on the original state.

For example:

Input:  VVLVLLLV
Output: VVVVVVVV

Input: LLLL Output: LLLL

Input: LVLV Output: VVVV

</p>

Make sure to read the input from stdin and print your answer to stdout.

inputFormat

The input consists of a single line containing a string of characters. Each character is either V or L, representing a cell in Lavaland.

You can assume that the string is non-empty and its length does not exceed typical constraints for contest problems.

outputFormat

Output a single line containing the resulting string after applying the transformation rules. The output should be printed to stdout.

## sample
VVLVLLLV
VVVVVVVV