#P2112. ACSL 2024-2025 Intermediate Division Contest #1 Rings
ACSL 2024-2025 Intermediate Division Contest #1 Rings
PROBLEM DESCRIPTION
ACSL Rings is a 3-player game where the object is to score points by tossing a ball through at least one of the rings. Points are awarded as follows:
- Through the aqua or red ring point
- Through the orange or green ring points
- Through the black ring points
- Through the space where rings overlap - the sum of the points for the rings plus

We will use a single letter to represent each of the above colors: aqua (A), red (R), orange (O),
green (G) and black (B). The overlapping areas will be given by letters in the order shown:
aqua and orange (AO), orange and black (OB), black and green (BG), and green and red (GR).
You will be given strings representing each player’s results for all tosses that go through at least one ring. The result of each toss will be separated by a single space. Output the players’ scores in descending order separated by a single space. If any of the players have the same score, it doesn’t matter which one of the tied scores appears first.
INPUT FORMAT
The input will consist of strings as described above. Each string will be no longer than characters.
OUTPUT FORMAT
Output the three scores in descending order, each separated by a single space.
SAMPLE
INPUT #1
GR A B
OB BG AO O
R G
OUTPUT #1
28 12 4
INPUT #2
A R O G B
A A B B
R O B
OUTPUT #2
14 14 10
INPUT #3
AO OB B G A B BG GR
R R G G AO AO BG BG B
AO GR A B R G O BG OB
OUTPUT #3
46 44 44
INPUT #4
A A A B B R O O O O
BG BG GR GR O O O A B
BG BG GR GR O O O B B G
OUTPUT #4
54 46 28
INPUT #5
A B B O O G AO OB GR BG
GR GR BG BG OB AO AO
B B B G G G A A A GR AO
OUTPUT #5
52 50 40
INPUT #6
GR BG OB AO A G B
A O B AO GR GR BG O GR AO
O O B G A A GR OB AO BG
OUTPUT #6
48 47 40
EXPLANATION
SAMPLE #1 EXPLANATION
Player 1’s tosses go through the green & red, aqua, and black rings for a score of .
Player 2 has a score of .
Player 3 has a score of .
The output is the string , the scores in descending order.