The festival of Holi is being celebrated at Amazon, where two rival teams—AWS and Prime—are competing in a special color-throwing game.
The players line up in a row, each belonging to either team A (AWS) or team P (Prime). During each turn, players act in order from first to last. When it's a player's turn, they can do one of the following:
You're given a string players
representing each person's team. The character 'A'
represents AWS and 'P'
represents Prime. The number of characters in the string equals the number of players.
The game proceeds from the first player to the last, skipping any players who have been colored. Assume every player uses optimal strategy to help their team win.
Predict which team will eventually declare victory. The output should be either "AWS"
or "Prime"
.
Input:
AP
Output:
AWS
Input:
APP
Output:
Prime