题目描述
Problem Description
Xiao a and uim enjoy playing Tic-Tac-Toe against each other. Everyone knows Tic-Tac-Toe, right? It's the game on a 3x3 grid where players place "O" and "X" (don't think too much about it), and the first to form a line of three wins.
Despite Xiao a's efforts to record the moves, he still can't beat uim.
Since Xiao a is a bit naive, uim always lets him go first. Xiao a's first move is always in the center.
This time, Xiao a wants to use a strategy. The game has just started, and there are less than three pieces on the board. Xiao a wants to know if, based on the current situation, he has a guaranteed winning strategy (meaning he plays optimally and can win no matter how his opponent plays).
Input Format
There are three lines representing the board state. "O" represents Xiao a, "X" represents uim, and "-" represents an empty spot. The number of pieces is guaranteed to be no more than three.
Output Format
There are two lines of output.
The first line should say xiaoa will win. if Xiao a can win, uim will win. if Xiao a is guaranteed to lose, or Dont know. if it's uncertain.
The second line should output the number of pieces that have been placed.
Sample Input and Output
Sample Input #1
---
-O-
---
Sample Output #1
Dont know.
1
Sample Input #2
---
-O-
-XO
Sample Output #2
xiaoa will win.
3
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分