Problem

Source: 2015 Grand Duchy of Lithuania, Mathematical Contest p3 (Baltic Way TST)

Tags: combinatorics, square table



A table consists of $17 \times 17$ squares. In each square one positive integer from $1$ to $17$ is written, every such number is written in exactly $17$ squares. Prove that there is a row or a column of the table that contains at least $5$ different numbers.