5. Two players are playing such a game. In one move, a player can place one pebble in one of the cells of a $1001 \times 1001$ square board (initially the board is empty; any number of pebbles can lie in one cell). They take turns. As soon as there are more than 5 pebbles in any row (vertical or horizontal), the player who made the last move is declared the loser. Which player can win regardless of the opponent's actions: the one who makes the first move or the one who moves second?
Answer. First. First solution. Before the 5005th pebble is placed on the board, the first player finds a row and a column with fewer than five pebbles (such must exist) and places a pebble in the cell at their intersection. If the second player has not made a mistake before, after the 5005th pebble is placed on the board (which, like all odd-numbered pebbles, is placed by the first player), we arrive at a situation where each row and each column contains exactly five pebbles. In this situation, the second player loses no matter what move they make. Second solution. Suppose the first player places the first pebble in the central cell of the board, and then places each of their pebbles symmetrically relative to the center of the board to the last pebble of the opponent. Then, if the first player makes a move in a row or column containing the central cell, there will be an odd number of pebbles there after this move, and if the first player's pebble ends up in a row or column not containing the central cell, there will be as many pebbles there after their move as in the row (column) symmetric to the center of the board. Thus, if after the first player's move there are more than 5 pebbles in some row or some column, then before their move there were a row or column with more than 5 pebbles. Therefore, the first player cannot lose with such a strategy, and since the game is finite, the second player will eventually lose.