Walgreens and CVS closed hundreds of stores, and Rite Aid shrank as it went through a bankruptcy reorganization.