#P2076. ACSL 2021-2022 Intermediate Division Contest #1 Fibonacci Clock
ACSL 2021-2022 Intermediate Division Contest #1 Fibonacci Clock
ACSL’s version of Philippe Chretien’s “Fibonacci Clock” displays time by changing the colors displayed in squares, whose side lengths correspond to the first Fibonacci numbers ( and ). Given the colors of the squares on the clock face, you must output the time that is represented in format. The colors will be given to you as individual characters representing the lower x square, the upper x square, the x square, the x square, and the x square in that order. (See https://basbrun.com/2015/05/04/fibonacci-clock/.)

Red squares are used to represent only hours and green squares are used to represent only minutes. Blue squares are used to represent both hours and minutes. White squares are ignored. To find the current hour, add the values of the red and blue squares. To find the current minutes, add the values of the green and blue squares and multiply by so that the number of minutes and seconds are in intervals of between and inclusive.
However, if the number of minutes is , change it to the next hour with minutes and if the number of hours is or more, change it to a valid time from to . For example, would become and would be .
The clock in the picture above is displaying . The hours are represented by the red x , blue x , and blue x squares . The minutes are represented by the blue x , the green x , and the blue x squares and .
The example at the left which uses the inputted characters R, W, G, B, G displays the time . The hours are represented by the x red square and the x blue square: . The minutes are represented by the x green, the x blue, and the x green squares: . The example at the right which uses the inputted characters W, B, B, G, R displays the time . The hours are and the minutes are .

INPUT FORMAT
There are sets of data. Each set has uppercase letters (R, W, B, or G) that represent the colors of the lower x , the upper x , the x , the x , and finally the x square, in that order. We guarantee that the input will represent a valid time from to .
OUTPUT FORMAT
For each line of data, print the time in hours and minutes formatted as .
SAMPLE
INPUT
R W G B G
W B B G R
W G B R B
G G B B B
W R G G G
OUTPUT
04:50
08:30
10:40
11:00
01:50