Adenosine triphosphate (ATP)
Through leaching. B horizons or subsoil get materials from above through accumulated rain water that leached these materials and precipitated it into the B horizon.
The outcome of the gram stain is based on differences in the cell's cell wall(different composition of the cell wall