Logo C++ Online Judge

C++

时间限制:1 s 空间限制:128 MB
TA:
统计

Description

Winning a Super Grand Slam is the highest honor for a table tennis player, and among men, only Ma Long and Fan Zhendong have done it so far. Recently, these two top players will play a table tennis training match.

Table tennis is an 11-point game, and the player who reaches 11 points first and is two points ahead of his opponent wins the game. (e.g. 11:10 is not considered a win, you need to play until 12:10)

For various reasons, only the winners of each point are recorded in this training match, and each point will be marked with a shortened letter of the scorer's name: For example, FFFFFFFFFFFMMMMMMMMMMMFM, means that Fan got 11 points in the first game, then Ma got 11 points, then both got 1 point each.

What you need to do is to summarize the scores for each game as follows: i.e., 0:11, 11:0, 1:1.

Input format

Each input file contains a number of lines of strings, which consist of upper case F M and E. E denotes the end of the match, and the program should ignore every recording after E.

Note: Since this is a training match, the match may go on for many games, and the game may end at any time, so it is not necessary for a particular game to be won or lost.

Output Format

Output the score of each game, Ma's score is recorded ahead of Fan's.

Constraint

The number of input lines is less than 100, and the number of letters is less than 10000.

Input Sample
FFFFFFFFFFFMMM
MMMMMMMMFME

Output Sample
0:11
11:0
1:1