atcoder#ARC148D. [ARC148D] mod M Game

[ARC148D] mod M Game

Score : 700700 points

Problem Statement

There are 2N2N integers A1,A2,...,A2NA_1, A_2, ..., A_{2N} written on a blackboard, and an integer MM at least 22. Alice and Bob will play a game. They will alternately perform the following operation, with Alice going first, until there is no number on the blackboard.

  • Choose a number and delete it from the blackboard.

At the end of the game, if the sum of numbers deleted by Alice modulo MM equals the sum of numbers deleted by Bob modulo MM, Bob wins; otherwise, Alice wins. Which player will win if both plays optimally?

Constraints

  • 1N2×1051 \leq N \leq 2 \times 10^5
  • 2M1092 \leq M \leq 10^9
  • 0AiM10 \leq A_i \leq M - 1
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN MM

A1A_1 A2A_2 \dots A2NA_{2N}

Output

If Alice wins, print Alice; if Bob wins, print Bob.

2 9
1 4 8 5
Alice

The game may proceed as follows.

  • Alice deletes 11.
  • Bob deletes 44.
  • Alice deletes 55.
  • Bob deletes 88.

In this case, the sum of numbers deleted by Alice modulo MM is (1+5)mod9=6(1 + 5) \bmod 9 = 6, and the sum of numbers deleted by Bob modulo MM is (4+8)mod9=3(4 + 8) \bmod 9 = 3. Since 636 \neq 3, Alice wins.

3 998244353
1 2 3 1 2 3
Bob