#P6369. Three in a Row on a Chessboard
Three in a Row on a Chessboard
Three in a Row on a Chessboard
Given an chessboard, multiple players are playing a tic-tac-toe game. Each player uses a unique letter to mark their moves. In this game, a player wins if they can align of their letters consecutively in a row, column, or diagonal.
Your task is to determine the winning player's letter from the current state of the chessboard.
inputFormat
The first line contains an integer , representing the size of the chessboard. The next lines each contain a string of length , representing the board's current state.
outputFormat
Output a single letter, which is the winner's letter. It is guaranteed that there is a winning move in the given board.
sample
3
XXX
OO.
OO.
X