A $2012 \times 2012$ table is to be filled with integers in such a way that each of the 4026 rows, columns, and main diagonals has a different sum. What is the smallest number of distinct values that must be used in the table?