Volleyball Game

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

Two teams, Team A and Team B, are playing a volleyball game. In volleyball, the first team to reach at least 25 points with a 2 point difference or more wins the game. A team gets a point when the ball lands on the opponent's side of the court or when the opponent hits the ball out of bounds. Create a program that determines which team won.

Input Specification

The only line of input will be a string which is made solely from the characters A and B. The letter represents a point gained by said team. A means that Team A scored a point; B means that Team B scored a point.

Output Specification

Print the letter of the team that won, or if the game is still ongoing, print Not finished instead.

Sample Input

AABAABBAABABABBBBAAABBABBBABBBBBABBABBBAB

Sample Output

B

Comments

There are no comments at the moment.