(d) As shown in figure,
$x_{CM} = \frac{M \times 0 + M \times 20 + M \times 20 + M \times 0}{4M} = 10\ cm$
Similarly $y_{CM} = 10\ cm$
Hence, distance of centre of mass from centre of any one sphere,
Say $r = \sqrt{(10 - 0)^{2} + (10 - 0)^{2}} = 10\sqrt{2}\ cm$