❌Naughts to Asr ⭕

It's day four of Ramadan at The Bright Beacen Mosque, and Mustafa is in the mosque for dhuhr(noon) prayer.

He finds 2 youngsters, Sajid and Irfan, playing naughts and crosses. They have a big pad and are competing for reward. Every time one of the boys wins a game, the opponent has to recite a line of the Quran. This means that the loser earns the reward for reciting the line of the Quran, but also that the winner earns the reward for making him recite that line of the Quran. According to them, the science checks out 🙃. Therefore the one who wins more also wins the most reward.

Mustafa prays dhuhr and returns a few hours later to pray asr prayer. The boys are still playing. According to Sajid, they have played 2113 games. They have lost count of who has won more games, but they logged each game into a file.

Each line of the file contains 9 moves because, for some reason, even after winning or drawing a game, the boys continued logging moves until all spaces on the grid were filled.

Each line in the file is as follows:

3,6,2,1,7,9,8,5,4

This means that the first move was played as a nought in box 3.

                                               
O

The second move was played as an X in box 6.

                                               
O
X

This game appears to result in player 2 winning.

                                               
XOO
OXX
OOX

The problem is that some games may look like there could be 2 winners. You need to work out who the winner was first despite the fact the boys continued to log more moves until the grid was completed.

According to Irfan, the boys alternated who would start a game. The first starter was Sajid, and every game they alternated who would start and therefore play as nought.

The boys don't want to know who won the most games or what their total number of wins was.

They want to know who won over the other. Therefore, if Irfan has won more games by 32, the answer should be inputted as irfan032.

So, your answer input should be in the form of either sajid000 or irfan000 (replacing the 000s with the actual number!).