6. The squares of an infinite chessboard are numbered as follows: in the first row and first column

we put 0, and then in every other square we put the smallest non-negative integer that does not
appear anywhere below it in the same column or anywhere to the left of it in the same row.
What number will appear in the 1000th row and 700th column? Can you generalize?