#P7928. Game of Stones

    ID: 21113 Type: Default 1000ms 256MiB

Game of Stones

Game of Stones

Alice and Bob are playing a game. There are \(n\) stones arranged in a row, each colored either red or blue. Alice moves first. In each turn, a player removes one stone from either end of the row. The first player to accumulate \(k\) red stones loses the game.

Both players are perfect, so they will choose their moves optimally. Given the configuration of stones and the losing threshold \(k\), determine the winner.

inputFormat

The first line contains two integers \(n\) and \(k\) (for example, \(1 \le n \le 50\), \(1 \le k\)). The second line is a string of length \(n\) consisting only of the characters R (red) and B (blue) which represent the colors of the stones from left to right.

outputFormat

Output a single line containing either Alice or Bob corresponding to the winner when both players play optimally.

sample

3 1
RBB
Bob