P1917 Tic-Tac-Toe II
Description
xiaoa and uim like to practice Tic-Tac-Toe with each other. Everyone has played Tic-Tac-Toe, right? It is played on a 3×3 grid with $\verb!OOXX!$ (don't get the wrong idea), and whoever gets $3$ in a row wins.
Although xiaoa tries hard to record the games, he still cannot beat uim.
Since xiaoa is a bit slow, uim always lets him move first. xiaoa’s first move is always the center.
This time, xiaoa wants to use a tactic. The game has just started, with fewer than $3$ pieces on the board. xiaoa wants to know, given the current position, whether he has a forced win (that is, if he plays optimally, he will win no matter how the opponent plays).
Input Format
Three lines representing the board, where $\verb!O!$ denotes xiaoa, $\verb!X!$ denotes uim, and $\verb!-!$ denotes an empty cell. It is guaranteed that the number of pieces does not exceed $3$.
Output Format
Two lines.
On the first line, if xiaoa will win, output `xiaoa will win.`. If xiaoa will lose, output `uim will win.`. If it is unknown, output `Dont know.`.
On the second line, output the number of pieces that have already been placed on the board.
Explanation/Hint
Translated by ChatGPT 5