You are a dealer at The One, the first all-binary casino in Las Vegas. The blackjack tables there do not use cards. They use bytes, an 8-bit sequence representing a number from 0 to 255, and nibbles, a 4-bit sequence representing a number from 0 to 15.
All day long you play the house's hand against one opponent after another. The owners know their statistics, and the strategy they handed you leaves gamblers with slightly worse than even odds.
Here are the rules of binary blackjack:
Byte Me!, or more nibbles by saying Nibble Me!, until he reaches his limit of 4 hits or has more than 510 points showing.The dealer follows these rules, listed in order of precedence, where a lower numbered rule overrides a higher numbered one:
Rule 1 turns on what the dealer can see: his own two cards, and one face-up card for each other player. Every card he cannot see is a byte, so its value is somewhere from 0 to 255. The dealer is certain he has won only when no filling of those unseen cards puts any player's total above his own.
The input is a non-empty series of at most 100 data sets. No blank line separates data sets.
A single data set has 6 components:
START N, where N is the number of players playing this hand, not counting the dealer. There are never more than 10 non-dealer players, and the dealer never plays by himself.END.A single line ENDOFINPUT follows the final data set.
Two more facts are worth knowing:
11111111, value 255. The dealer has no knowledge of this.Report the actions the dealer takes and how the dealer fares with the resulting hand.
For each data set print exactly one output set, made of these components:
HAND N, where N is the number of players playing this hand, not counting the dealer.Byte me! for a byte hit and Nibble me! for a nibble hit.Win! if the dealer wins, Bust! if the dealer loses by busting, and Lose! if the dealer loses without busting.