Energy evolution and water immersion-induced weakening in sandstone roof of coal mines