There is an grid, where the cell at the i-th row from the top and the j-th column from the left contains the integer
Over turns, integers will be announced. On Turn the integer is announced, and the cell containing is marked. Determine the turn on which Bingo is achieved for the first time. If Bingo is not achieved within T turns, print .
Here, achieving Bingo means satisfying at least one of the following conditions:
There exists a row in which all cells are marked.
There exists a column in which all cells are marked.
There exists a diagonal line (from top-left to bottom-right or from top-right to bottom-left) in which all cells are marked.