#K95132. Tic Tac Toe Winner Check
Tic Tac Toe Winner Check
Tic Tac Toe Winner Check
Given a 3x3 Tic Tac Toe board, determine if the first player ('X') has won the game. A win is achieved if any row, any column, or either of the two diagonals is completely filled with 'X'.
The grid is represented as 3 lines each containing 3 characters. Each character can be:
X
: A move by the first player.O
: A move by the second player..
: An empty cell.
You should output First if the first player wins, and No Winner otherwise.
Winning conditions satisfy one of the following criteria:
- Any row is exactly $$X, X, X$$
- Any column is exactly $$X, X, X$$
- The main diagonal is exactly $$X, X, X$$
- The anti-diagonal is exactly $$X, X, X$$
inputFormat
The input is provided through standard input (stdin) and consists of 3 lines, each representing a row of the Tic Tac Toe board. Each line contains exactly 3 characters which can be 'X', 'O', or '.'.
Example:
X.X .OX ..O
outputFormat
Print a single line to standard output (stdout) with the string First if the first player wins, otherwise print No Winner.
## sampleXXX
...
...
First