Let $A_i$ the number of columns that contain the number $i$ and $B_i$ the number of rows that contain the number $i$.
Obviously $A_iB_i\geq 17$ (since every number is written exactly $17$ times).
For the column $j$ we denote by $a_{j,k}$ we set $a_{j,i}=1$ if the number $i$ is contained in this column.
Pick randomly a column $j$ and denote by $X$ the number of different numbers that contained in this column.
We have that $\mathbb E(X)=\mathbb E\left (\sum_{i=1}^{17}a_{j,i}\right)=\sum_{i=1}^{17}\mathbb{E}(a_{j,i})=\sum_{i=1}^{17}\mathbb{P}( j \,\,\,contains \,\,the \,\,number\,\, i)=\sum_{i=1}^{17}\dfrac{A_i}{17}$.
Similarly for the rows we get the expected value $\sum_{i=1}^{17}\dfrac{B_i}{17}$.
Thus, in total(columns and rows ) the expected value of $X$ is $\dfrac{1}{34}\sum_{i=1}^{17} (A_i+B_i)$.
Using $AM-GM$ we have that $A_i+B_i\geq 2\sqrt{A_iB_i}\geq 2\sqrt{17}$.
So $\dfrac{1}{34}\sum_{i=1}^{17} (A_i+B_i)\geq \dfrac{1}{34}\cdot 17\cdot 2\sqrt{17}=\sqrt{17}=4.123.....>4$.
Since $X\in \mathbb{Z}$ there is a column or a row that contains at least five different numbers.