A $3\times3$ grid contains altogether six squares that are formed by its nine entries: there are five squares whose sides are parallel to the sides of the grid (four small ones and a big one), and there is one square that is tilted by $45$ degrees:
a b c a b b c a c b
d e f contains d e e f d e e f d f
g h i g h h i g i h
Determine all possible ways of arranging the nine numbers $1,2,3,\ldots,9$ in a $3\times3$ grid, such that the four numbers in the corners of each of the six squares add up to the same sum.