In the experiment you described, Substance A changes red litmus paper to blue, indicating that it is a base (alkaline substance). Bases have a pH greater than 7 and turn red litmus paper blue.
Substance B changes blue litmus paper to red, which indicates that it is an acid. Acids have a pH less than 7 and turn blue litmus paper red.
Therefore, the results of the experiment can be accurately explained by stating that Substance A is a base and raises the pH of the solution, while Substance B is an acid and lowers the pH of the solution.