P29860 [洛谷] [THUPC2022 Finals] Simple Card Game
提高
题目描述

Problem Description

Alice and Bob have been playing many complex games recently, so they want to relax with some simpler games.

They remember a very simple game called "Hold Seven," which only requires a deck of poker cards to play. The traditional "Hold Seven"玩法 is a bit complex, so Alice and Bob decide to play a simplified version.

The game involves poker cards including Spades, Hearts, Clubs, and Diamonds, with each suit having cards numbered from 1 to 13, totaling 52 cards.

The simplified rules are as follows:

  1. First, divide a deck of 52 cards equally into two sets of 26 each, and each player takes one set.
  2. The player who holds the Seven of Spades places it on the table.
  3. Then, players take turns to play a card from their hand to the table. A card can be played if it meets one of the following conditions:
    - The card's number is 7.
    - There is a card on the table of the same suit and exactly one number apart from the card to be played.
  4. If a player cannot play a card according to the rules, that player loses, and the other player wins. If both players play all their cards, the game is a draw.

Since the game involves independent sequences for different suits, players often arrange the Sevens of different suits vertically and connect the cards of the same suit on both sides of the Seven.

Given that Alice and Bob are both intelligent, and now their initial hands are provided, calculate the outcome of the game when both play optimally.

Input Format

Since one player's hand can deduce the other's, the input only includes all of Alice's cards.

The input consists of one line with 26 space-separated strings, each representing a card in Alice's hand.

Each card is represented in the format of suit + number. The suit is denoted by a character, S for Spades, H for Hearts, C for Clubs, D for Diamonds; the number is represented by a one or two-digit number, ranging from 1 to 13, without leading zeros. For example, the Seven of Spades is represented by the string S7.

Output Format

The output consists of one line with a string indicating the game's result. If Alice can win the game, output Alice; if Bob can win, output Bob; if it's a draw, output Draw.

Sample Input and Output

Sample Input #1

S4 S6 S11 S13 H3 H4 H5 H6 H8 H10 H12 C2 C4 C5 C6 C8 C9 C11 C13 D1 D4 D5 D6 D8 D10 D12

Sample Output #1

Bob

Sample Input #2

S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13

Sample Output #2

Draw

Sample Input #3

H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 C13 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13

Sample Output #3

Alice

Notes

For $100\%$ of the data, the input cards are guaranteed to be in the format described in the input format, and all 26 cards are unique.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
S4 S6 S11 S13 H3 H4 H5 H6 H8 H10 H12 C2 C4 C5 C6 C8 C9 C11 C13 D1 D4 D5 D6 D8 D10 D12
样例输出
Bob