Professional Documents
Culture Documents
Problem 10
Problem 10
Input
The input will consist of several lines; each line consists of a sequence of zero or more digits
representing a partially completed game. The first digit is player A’s move; the second player
B’s move; and so on. You are to complete the game using a perfect strategy for both players and
to determine who wins.
Output
For each game, print a line consisting of the input, followed by a space, followed by ‘A’
or ‘B’ to indicate the eventual winner of the game.