Page not loading? Try clicking here.
Placeholder

#7041

A battle between two prideful leaders 1s 1024MB

Problems

Two proud integers, A and B, have started a fight according to the following rules.

  1. The number with the smaller units digit decreases by 2, and the number with the larger units digit decreases by 19. (If they are the same, both are replaced by the quotient when divided by 10.)

  2. The fight ends if one of the two integers becomes less than or equal to 0.

  3. After the fight ends, the integer with the larger value wins.


Input

The first line contains two integers A and B. (1 \le A, B \le 10\ 000)


Output

On the first line, print A if integer A wins, B if integer B wins, and D otherwise.


Example #1

987 5187
B

Example #2

193 23
D

Example #3

380 4003
A


Source

klee
You must sign in to write code.