#K86322. Battle of the Bands

    ID: 36839 Type: Default 1000ms 256MiB

Battle of the Bands

Battle of the Bands

In the Battle of the Bands, two bands compete by performing rounds. Each band has a set of members with assigned skill levels. In each round, the highest available member from each band performs, and their skill values are added to the band's total score. If one band has extra members, their remaining skills are added to that band's score after the rounds have finished.

The total score for Band A can be represented by the formula:

(score_A = \sum_{i=1}^{\min(n,m)} a_i + \begin{cases} \sum_{i=\min(n,m)+1}^{n} a_i & \text{if } n > m \ 0 & \text{otherwise} \end{cases})

A similar formula applies for Band B. Your task is to determine which band wins based on the total scores, or output Draw if they are equal.

inputFormat

The input is read from standard input (stdin) and consists of three lines:

  • The first line contains two space-separated integers n and m, representing the number of members in Band A and Band B, respectively.
  • The second line contains n space-separated integers, each representing the skill level of a member of Band A.
  • The third line contains m space-separated integers, each representing the skill level of a member of Band B.

outputFormat

Output a single line to standard output (stdout) containing one of the following: A, B, or Draw, which indicates the winner of the battle or a draw if the scores are equal.

## sample
3 3
4 8 7
5 6 9
B