#B4018. Team Ranking in Professional League

    ID: 11675 Type: Default 1000ms 256MiB

Team Ranking in Professional League

Team Ranking in Professional League

In the professional league of this game, the ranking of Team A and Team B is determined by their number of wins, goal difference, and the number of draws. The ranking rules are as follows:

  • A team with a higher number of wins ranks better.
  • If the wins are equal, the team with a higher goal difference \( (\text{GD}) \) ranks better.
  • If the goal difference is also equal, the team with a lower number of draws ranks better.
It is guaranteed that there will be no case where the number of draws is equal when both wins and goal difference are the same. Given the data for two teams, determine which team ranks higher. The input for each team consists of three integers: wins, goal difference, and draws, separated by spaces. The first line is for Team A and the second line is for Team B.

inputFormat

The input consists of two lines. The first line contains three integers representing Team A's wins, goal difference, and draws (in that order). The second line contains three integers representing Team B's wins, goal difference, and draws.

outputFormat

Output a single uppercase letter: ( \text{A} ) if Team A is ranked higher, or ( \text{B} ) if Team B is ranked higher.

sample

5 10 1
4 9 2
A