Egg shells are primarily composed of calcium carbonate (\( \text{CaCO}_3 \)). When an acid reacts with calcium carbonate, it produces carbon dioxide gas (\( \text{CO}_2 \)), water, and a calcium salt. Carbon dioxide turns limewater milky (due to the formation of insoluble calcium carbonate).
The reaction is: \[ \text{CaCO}_3(s) + 2\text{HCl}(aq) \rightarrow \text{CaCl}_2(aq) + \text{H}_2\text{O}(l) + \text{CO}_2(g) \]
Therefore, the solution \( S \) is hydrochloric acid (\( \text{HCl} \)), and the gas \( G \) is carbon dioxide (\( \text{CO}_2 \)).