On addition of aqueous sodium hydroxide to an aqueous solution of salt R, a white precipitate is obtained, soluble in an excess of the hydroxide. A white ppt is also obtained when R is treated with aqueous ammonia , but it is insoluble in excess. Which of the following could be R?

A: Al2(SO4)3
B: CaSO4
c: MgSO4
D: MnSO4
E: ZnSO4

Ans: A
Someone please explain?