1. Magnesium in the presence of oxygen burns to produce basic magnesium oxide. When it its added to water, it produces magnesium hydroxide, which turns the red litmus solution into blue.
2. Sulphur combines with oxygen, it forms acidic oxide. It get changed into sulphurous acid when react with water. This turns the blue litmus solutions into red.