For this Question: The underage Harry and Cedric reach the Triwizard Cup together in the hedge maze, which turns out to be a portkey that transports them to a graveyard where Pettigrew and Voldemort are waiting. After Pettigrew murders Cedric with the Killing Curse on Voldemort's order, Voldemort challenges Harry with a very tricky spell, <b>The string leviosa</b>.

In order to survive this spell, Harry has to answer the following question:
There is a string of size N consisting of characters A, B, and C. The character A can be transformed to either character B or character C. Now, two players play a game with the following rules turn wise. In each turn, the player with the turn chooses a position with character A in the string and transforms the character to another character (B or C). The only restriction to the string is that there can't be two consecutive <b>B</b>s or two consecutive <b>C</b>s in the string. The player who cannot make a move loses. Which player wins the game?

Can you help Harry in surviving the dangerous spell?The first line of the input contains a single integer N, the length of the string.
The second line of the input contains N characters of the string.

Constraints
1 <= N <= 100000
The characters in the string are restricted to A, B, and C.
There are no consecutive Bs or Cs in the input string.Output "Player1" if the player who starts the game wins, else output "Player2" (without quotes).Sample Input
3
ACA

Sample Output
Player2

Explanation: Player1 changes the first or the last character to B, the second player changes the remaining A to B in the next turn. After that, player1 cannot make a move since there are no more As in the string.

Sample Input
4
BACA

Sample Output
Player1

Explanation: Player1 changes the last character in the string to B and player2 cannot make a move further., I have written this Solution Code: n = int(input())
input_string = list(input())
win = False

if len(input_string) == 1:
    if input_string[0] == "A":
        win = not win
else:
    for i in range(n):
        if input_string[i] == "A":
            if i == 0:
                if input_string[i + 1] == "B":
                    input_string[i] = "C"
                    win = not win
                elif input_string[i + 1] == "C":
                    input_string[i] = "B"
                    win = not win
            elif i == n - 1:
                if input_string[i - 1] == "B":
                    input_string[i] = "C"
                    win = not win
                elif input_string[i - 1] == "C":
                    input_string[i] = "B"
                    win = not win
            else:
                if input_string[i - 1] == input_string[i + 1]:
                    if input_string[i - 1] == "B":
                        input_string[i] = "C"
                        win = not win
                    elif input_string[i - 1] == "C":
                        input_string[i] = "B"
                        win = not win
                    else:
                        input_string[i] = "B"
                        win = not win
                else:
                    if (input_string[i - 1] == "B" and input_string[i + 1] == "C") or (input_string[i - 1] == "C" and input_string[i + 1] == "B"):
                        input_string[i] = "X"
                    elif input_string[i - 1] == "B" and input_string[i + 1] == "A":
                        input_string[i] = "C"
                        win = not win
                    elif input_string[i - 1] == "C" and input_string[i + 1] == "A":
                        input_string[i] = "B"
                        win = not win



if win:
    print("Player1")
else:
    print("Player2"), In this Programming Language: Python, Now tell me if this Code is compilable or not?