<image>The points of intersection of the network of bars shown are labelled with the numbers 1 to 10. The sums $S$ of the four numbers on the vertices of each square are
all the same. What is the minimum value of $S$?