Basic idea for solving the program.




-------
Let us assume that numbers arranged in the squares are not all equal. Thus, the numbers have a minium number. Consider a square that has this number. The, number in the square is the average of the numbers in the neighbouring squares. Since the number under consideration is the minimum, all the numbers in the neighouring squares is equal to the minimum number. Repeating this process in the neigbouring squares, we get that all the numbers are equal.
QED.