Solution for percolation.